summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAlexander Musman <alexander.musman@gmail.com>2015-09-21 14:41:00 +0000
committerAlexander Musman <alexander.musman@gmail.com>2015-09-21 14:41:00 +0000
commit8e261be911060e834c5e37b965e85415c8fb8b54 (patch)
tree0a7ab139be9dbc38d4de59c6f9fac07d6c064af6 /clang/test
parentef3a04aae7a4b19f57be950824a37ec10e67fad6 (diff)
downloadbcm5719-llvm-8e261be911060e834c5e37b965e85415c8fb8b54.tar.gz
bcm5719-llvm-8e261be911060e834c5e37b965e85415c8fb8b54.zip
Fix assertion in inline assembler IR gen
Several inputs may not refer to one output constraint in inline assembler insertions, clang was failing on assertion on such test case. llvm-svn: 248158
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/asm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Sema/asm.c b/clang/test/Sema/asm.c
index 9ed8d843eaf..76e20158c40 100644
--- a/clang/test/Sema/asm.c
+++ b/clang/test/Sema/asm.c
@@ -236,3 +236,15 @@ void test16()
: "m" (test16_baz)); // expected-error {{reference to a global register variable in asm output with a memory constraint 'm'}}
}
+int test17(int t0)
+{
+ int r0, r1;
+ __asm ("addl %2, %2\n\t"
+ "movl $123, %0"
+ : "=a" (r0),
+ "=&r" (r1)
+ : "1" (t0), // expected-note {{constraint '1' is already present here}}
+ "1" (t0)); // expected-error {{more than one input constraint matches the same output '1'}}
+ return r0 + r1;
+}
+
OpenPOWER on IntegriCloud