A number in an input constraint can't point to a read-write ('+') constraint. Fixes PR3904.
llvm-svn: 118145
diff --git a/clang/test/Sema/asm.c b/clang/test/Sema/asm.c
index 52611fa..73d081d 100644
--- a/clang/test/Sema/asm.c
+++ b/clang/test/Sema/asm.c
@@ -79,3 +79,9 @@
// <rdar://problem/7574870>
asm volatile (""); // expected-warning {{meaningless 'volatile' on asm outside function}}
+
+// PR3904
+int test8(int i) {
+ // A number in an input constraint can't point to a read-write constraint.
+ asm ("" : "+r" (i), "=r"(i) : "0" (i)); // expected-error{{invalid input constraint '0' in asm}}
+}