[llvm-bugs] [Bug 25495] New: Inline assembly does not support macro
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Wed Nov 11 13:14:01 PST 2015
    
    
  
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: unassignedclangbugs at nondot.org
          Reporter: olivier at labapart.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151111/e0e1fbb6/attachment.html>
    
    
More information about the llvm-bugs
mailing list