summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema/asm.c')
-rw-r--r--clang/test/Sema/asm.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/Sema/asm.c b/clang/test/Sema/asm.c
index 67da197426c..29a55c610de 100644
--- a/clang/test/Sema/asm.c
+++ b/clang/test/Sema/asm.c
@@ -295,3 +295,24 @@ int test17(int t0)
return r0 + r1;
}
+void test18()
+{
+ // expected-error@+2 {{duplicate use of asm operand name "lab"}}
+ // expected-note@+1 {{asm operand name "lab" first referenced here}}
+ asm goto ("" : : : : lab, lab, lab2, lab);
+ // expected-error@+2 {{duplicate use of asm operand name "lab"}}
+ // expected-note@+1 {{asm operand name "lab" first referenced here}}
+ asm goto ("xorw %[lab], %[lab]; je %l[lab]" : : [lab] "i" (0) : : lab);
+lab:;
+lab2:;
+ int x,x1;
+ // expected-error@+2 {{duplicate use of asm operand name "lab"}}
+ // expected-note@+1 {{asm operand name "lab" first referenced here}}
+ asm ("" : [lab] "=r" (x),[lab] "+r" (x) : [lab1] "r" (x));
+ // expected-error@+2 {{duplicate use of asm operand name "lab"}}
+ // expected-note@+1 {{asm operand name "lab" first referenced here}}
+ asm ("" : [lab] "=r" (x1) : [lab] "r" (x));
+ // expected-error@+1 {{invalid operand number in inline asm string}}
+ asm ("jne %l0":::);
+ asm goto ("jne %l0"::::lab);
+}
OpenPOWER on IntegriCloud