summaryrefslogtreecommitdiff
path: root/test/Sema/asm.c
diff options
context:
space:
mode:
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'}}
+}
+