[llvm-bugs] [Bug 42583] New: "-cc1as" doesn't supports non absolute preprocessor expressions

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 11 05:59:55 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42583

            Bug ID: 42583
           Summary: "-cc1as" doesn't supports non absolute preprocessor
                    expressions
           Product: clang
           Version: 8.0
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: qwertytmp1 at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

It is not possible to compile following assembly source code:
```
#define OPERATION_ADD 0
#define OPERATION_SUB 1

.macro EXECUTE operation

.if \operation == OPERATION_ADD
        add x0, x1, #1
.endif

.if \operation == OPERATION_SUB
        sub x0, x1, #1
.endif

.endm

EXECUTE OPERATION_ADD
```


Clang reports following error:
```
/opt/toolchains/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04/bin/aarch64-funnyos-gnueabi-clang
-c preprocessor_arm.s
<instantiation>:2:5: error: expected absolute expression
.if OPERATION_SUB == OPERATION_ADD
    ^
preprocessor_arm.s:16:1: note: while in macro instantiation
EXECUTE OPERATION_SUB
^
<instantiation>:6:5: error: expected absolute expression
.if OPERATION_SUB == OPERATION_SUB
    ^
preprocessor_arm.s:16:1: note: while in macro instantiation
EXECUTE OPERATION_SUB
^
```

P.S. aarch64-funnyos-gnueabi-clang is a symlink to clang.
P.S. As I frequently wrote before: "It compiles by GCC".
P.P.S. LLVM is a future :)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190711/58ef2f96/attachment.html>


More information about the llvm-bugs mailing list