aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/asm.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-11 00:23:13 +0000
committerChris Lattner <sabre@nondot.org>2009-03-11 00:23:13 +0000
commit85759278332404e96d4bb89d0e976e46158cd026 (patch)
treebbbacc9a2da3f7200108fc5542e75b961c1913a8 /test/Sema/asm.c
parented6c17617998e38b146479fc0b7a3baa636c7e61 (diff)
fix PR3258 by rejecting invalid numeric operands.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66618 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/asm.c')
-rw-r--r--test/Sema/asm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/Sema/asm.c b/test/Sema/asm.c
index 32f32c6691..6ed9c50d62 100644
--- a/test/Sema/asm.c
+++ b/test/Sema/asm.c
@@ -55,7 +55,7 @@ void test6(long i) {
asm("nop" : : "er"(i));
}
-void asm_string_tests() {
+void asm_string_tests(int i) {
asm("%!"); // simple asm string, %! is not an error.
asm("%!" : ); // expected-error {{invalid % escape in inline assembly string}}
asm("xyz %" : ); // expected-error {{invalid % escape in inline assembly string}}
@@ -64,4 +64,8 @@ void asm_string_tests() {
asm ("%[somename]" :: "i"(4)); // expected-error {{unknown symbolic operand name in inline assembly string}}
asm ("%[somename" :: "i"(4)); // expected-error {{unterminated symbolic operand name in inline assembly string}}
asm ("%[]" :: "i"(4)); // expected-error {{empty symbolic operand name in inline assembly string}}
+
+ // PR3258
+ asm("%9" :: "i"(4)); // expected-error {{invalid operand number in inline asm string}}
+ asm("%1" : "+r"(i)); // ok, referring to input.
}