llvm-project/clang/test/Parser/no-gnu-inline-asm.c
Steven Wu 6b72a6753b Allow AsmLabel with -fno-gnu-inline-asm
Summary:
AsmLabel is heavily used in system level and firmware to redirect
function and access platform specific labels. They are also extensively
used in system headers which makes this option unusable for many
users. Since AsmLabel doesn't introduce any assembly code into the
output binary, it shouldn't be considered as inline-asm.

Reviewers: bob.wilson, rnk

Reviewed By: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D9679

llvm-svn: 237048
2015-05-11 21:14:09 +00:00

13 lines
423 B
C

// RUN: %clang_cc1 %s -triple i686-apple-darwin -verify -fsyntax-only -fno-gnu-inline-asm
asm ("INST r1, 0"); // expected-error {{GNU-style inline assembly is disabled}}
void foo() __asm("__foo_func"); // AsmLabel is OK
int foo1 asm("bar1") = 0; // OK
void f (void) {
long long foo = 0, bar;
asm volatile("INST %0, %1" : "=r"(foo) : "r"(bar)); // expected-error {{GNU-style inline assembly is disabled}}
return;
}