summaryrefslogtreecommitdiff
path: root/test/Sema/asm.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-06-09 19:08:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-06-09 19:08:19 +0000
commit798321d8eb5630cd4a8f490a4f25e32ef195fb07 (patch)
treea59f5569ef36d00388c0428426abef26aa9105b6 /test/Sema/asm.c
parent5e20cdd81c44a443562a09007668ffdf76c455af (diff)
Diffstat (limited to 'test/Sema/asm.c')
-rw-r--r--test/Sema/asm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Sema/asm.c b/test/Sema/asm.c
index 6c6f3f398e33..1a1e02993a72 100644
--- a/test/Sema/asm.c
+++ b/test/Sema/asm.c
@@ -204,3 +204,20 @@ void fn6() {
: "=rm"(a), "=rm"(a)
: "11m"(a)) // expected-error {{invalid input constraint '11m' in asm}}
}
+
+// PR14269
+typedef struct test16_foo {
+ unsigned int field1 : 1;
+ unsigned int field2 : 2;
+ unsigned int field3 : 3;
+} test16_foo;
+test16_foo x;
+void test16()
+{
+ __asm__("movl $5, %0"
+ : "=rm" (x.field2)); // expected-error {{reference to a bit-field in asm output with a memory constraint '=rm'}}
+ __asm__("movl $5, %0"
+ :
+ : "m" (x.field3)); // expected-error {{reference to a bit-field in asm input with a memory constraint 'm'}}
+}
+