llvm-project/clang/test/Sema/heinous-extensions-on.c

10 lines
320 B
C
Raw Normal View History

// RUN: %clang_cc1 %s -verify -fheinous-gnu-extensions
2009-07-22 08:43:08 +08:00
void foo() {
int a;
// PR3788
2012-10-26 15:02:46 +08:00
asm("nop" : : "m"((int)(a))); // expected-warning {{cast in an inline asm context requiring an l-value}}
2009-07-22 08:43:08 +08:00
// PR3794
2012-10-26 15:02:46 +08:00
asm("nop" : "=r"((unsigned)a)); // expected-warning {{cast in an inline asm context requiring an l-value}}
}