summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/ms-inline-asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema/ms-inline-asm.c')
-rw-r--r--clang/test/Sema/ms-inline-asm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Sema/ms-inline-asm.c b/clang/test/Sema/ms-inline-asm.c
index 69f234e5e9a..83b80294ff9 100644
--- a/clang/test/Sema/ms-inline-asm.c
+++ b/clang/test/Sema/ms-inline-asm.c
@@ -32,3 +32,21 @@ void f() {
mov eax, TYPE bar // expected-error {{unable to lookup expression}}
}
}
+
+void rdar15318432(void) {
+ // We used to crash on this. When LLVM called back to Clang to parse a name
+ // and do name lookup, if parsing failed, we did not restore the lexer state
+ // properly.
+
+ // expected-error@+2 {{expected identifier}}
+ __asm {
+ and ecx, ~15
+ }
+
+ int x = 0;
+ // expected-error@+3 {{expected identifier}}
+ __asm {
+ and ecx, x
+ and ecx, ~15
+ }
+}
OpenPOWER on IntegriCloud