aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/asm.c')
-rw-r--r--test/Sema/asm.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/Sema/asm.c b/test/Sema/asm.c
index 89c8c574eb5a..6c6f3f398e33 100644
--- a/test/Sema/asm.c
+++ b/test/Sema/asm.c
@@ -107,6 +107,7 @@ void test10(void){
register int r asm ("cx");
register int rr asm ("rr_asm"); // expected-error{{unknown register name 'rr_asm' in asm}}
+ register int rrr asm ("%"); // expected-error{{unknown register name '%' in asm}}
}
// This is just an assert because of the boolean conversion.
@@ -163,3 +164,43 @@ double f_output_constraint(void) {
__asm("foo1": "=f" (result)); // expected-error {{invalid output constraint '=f' in asm}}
return result;
}
+
+void fn1() {
+ int l;
+ __asm__(""
+ : [l] "=r"(l)
+ : "[l],m"(l)); // expected-error {{asm constraint has an unexpected number of alternatives: 1 vs 2}}
+}
+
+void fn2() {
+ int l;
+ __asm__(""
+ : "+&m"(l)); // expected-error {{invalid output constraint '+&m' in asm}}
+}
+
+void fn3() {
+ int l;
+ __asm__(""
+ : "+#r"(l)); // expected-error {{invalid output constraint '+#r' in asm}}
+}
+
+void fn4() {
+ int l;
+ __asm__(""
+ : "=r"(l)
+ : "m#"(l));
+}
+
+void fn5() {
+ int l;
+ __asm__(""
+ : [g] "+r"(l)
+ : "[g]"(l)); // expected-error {{invalid input constraint '[g]' in asm}}
+}
+
+void fn6() {
+ int a;
+ __asm__(""
+ : "=rm"(a), "=rm"(a)
+ : "11m"(a)) // expected-error {{invalid input constraint '11m' in asm}}
+}