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

            Bug ID: 25495
           Summary: Inline assembly does not support macro
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: oliv...@labapart.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

clang does not support assembly macro when defined with inline assembly. GCC
supports it and produce the expected binary.

This use case is actually present in newlib source code
(https://sourceware.org/newlib/).

Source code:
-------- hello.c ----------------
asm(".macro  COPY\n\t"
    "mov r0, r1\n\t"
    ".endm"
    );

int main(void) {
  asm ("COPY\n");
  return 0;
}
---------------------------------

Here is the error generated by clang:
$ clang-3.8 -target arm-none-eabi -c hello.c 
hello.c:7:8: error: invalid instruction mnemonic 'copy'
  asm ("COPY\n");
       ^
<inline asm>:1:2: note: instantiated into assembly here
        COPY
        ^~~~
1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to