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

            Bug ID: 42200
           Summary: -emit-llvm accepts wrong code
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: zhong...@pku.org.cn
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

My clang is 9.0.0, and my code is:

int pixels;
void test() {
 asm volatile("%0 %1" : "+r" (pixels) : : "%eax");
}

With other parameters, clang rejects the code:

source>:3:15: error: unexpected token at start of statement

 asm volatile("%0 %1" : "+r" (pixels) : : "%eax");

              ^

<inline asm>:1:2: note: instantiated into assembly here

        %ecx %ecx

        ^

1 error generated.

Compiler returned: 1

However, with -emit-llvm, it accepts the code. It seems to be incorrect?

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

Reply via email to