introduce a new -fheinous-gnu-extensions flag that enables really
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66910 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/heinous-extensions-on.c b/test/Sema/heinous-extensions-on.c
new file mode 100644
index 0000000..6b831f1
--- /dev/null
+++ b/test/Sema/heinous-extensions-on.c
@@ -0,0 +1,10 @@
+// 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}}
+}
+