mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 01:56:06 +00:00

really horrible extensions that are disabled by default but that can be accepted by -fheinous-gnu-extensions (but which always emit a warning when enabled). As our first instance of this, implement PR3788/PR3794, which allows non-lvalues in inline asms in contexts where lvalues are required. bleh. llvm-svn: 66910
11 lines
343 B
C
11 lines
343 B
C
// RUN: clang %s -verify -fheinous-gnu-extensions
|
|
|
|
int foo() {
|
|
int a;
|
|
// PR3788
|
|
asm("nop" : : "m"((int)(a))); // expected-warning {{cast in a inline asm context requiring an l-value}}
|
|
// PR3794
|
|
asm("nop" : "=r"((unsigned)a)); // expected-warning {{cast in a inline asm context requiring an l-value}}
|
|
}
|
|
|