summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/ms-inline-asm.c
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2014-07-25 02:27:14 +0000
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2014-07-25 02:27:14 +0000
commit2f93b448a8ca44d90b5c8d0e0c655db72093fb1b (patch)
treedbeda8a4b7b3dc103bfbb55a912acc91308cb690 /clang/test/Sema/ms-inline-asm.c
parentc9fa5dd61882c2b272d887abc3a33dae5bbbcedc (diff)
downloadbcm5719-llvm-2f93b448a8ca44d90b5c8d0e0c655db72093fb1b.tar.gz
bcm5719-llvm-2f93b448a8ca44d90b5c8d0e0c655db72093fb1b.zip
clang-cl: Merge adjacent single-line __asm blocks
Summary: This patch extends the __asm parser to make it keep parsing input tokens as inline assembly if a single-line __asm line is followed by another line starting with __asm too. It also makes sure that we correctly keep matching braces in such situations by separating the notions of how many braces we are matching and whether we are in single-line asm block mode. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4598 llvm-svn: 213916
Diffstat (limited to 'clang/test/Sema/ms-inline-asm.c')
-rw-r--r--clang/test/Sema/ms-inline-asm.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/clang/test/Sema/ms-inline-asm.c b/clang/test/Sema/ms-inline-asm.c
index 66504aa0841..e1d79c116c8 100644
--- a/clang/test/Sema/ms-inline-asm.c
+++ b/clang/test/Sema/ms-inline-asm.c
@@ -60,13 +60,13 @@ int t2(int *arr, int i) {
}
// expected-error@+1 {{cannot use base register with variable reference}}
- __asm mov eax, arr[ebp + 1 + (2 * 5) - 3 + 1<<1]
+ __asm { mov eax, arr[ebp + 1 + (2 * 5) - 3 + 1<<1] }
// expected-error@+1 {{cannot use index register with variable reference}}
- __asm mov eax, arr[esi * 4]
+ __asm { mov eax, arr[esi * 4] }
// expected-error@+1 {{cannot use more than one symbol in memory operand}}
- __asm mov eax, arr[i]
+ __asm { mov eax, arr[i] }
// expected-error@+1 {{cannot use more than one symbol in memory operand}}
- __asm mov eax, global[i]
+ __asm { mov eax, global[i] }
// FIXME: Why don't we diagnose this?
// expected-Xerror@+1 {{cannot reference multiple local variables in assembly operand}}
@@ -80,22 +80,22 @@ typedef struct {
} A;
void t3() {
- __asm mov eax, [eax] UndeclaredId // expected-error {{unknown token in expression}}
+ __asm { mov eax, [eax] UndeclaredId } // expected-error {{unknown token in expression}}
// FIXME: Only emit one diagnostic here.
// expected-error@+2 {{unexpected type name 'A': expected expression}}
// expected-error@+1 {{unknown token in expression}}
- __asm mov eax, [eax] A
+ __asm { mov eax, [eax] A }
}
void t4() {
// The dot in the "intel dot operator" is optional in MSVC. MSVC also does
// global field lookup, but we don't.
- __asm mov eax, [0] A.a
- __asm mov eax, [0].A.a
- __asm mov eax, [0].a // expected-error {{Unable to lookup field reference!}}
- __asm mov eax, fs:[0] A.a
- __asm mov eax, fs:[0].A.a
- __asm mov eax, fs:[0].a // expected-error {{Unable to lookup field reference!}}
- __asm mov eax, fs:[0]. A.a // expected-error {{Unexpected token type!}}
+ __asm { mov eax, [0] A.a }
+ __asm { mov eax, [0].A.a }
+ __asm { mov eax, [0].a } // expected-error {{Unable to lookup field reference!}}
+ __asm { mov eax, fs:[0] A.a }
+ __asm { mov eax, fs:[0].A.a }
+ __asm { mov eax, fs:[0].a } // expected-error {{Unable to lookup field reference!}}
+ __asm { mov eax, fs:[0]. A.a } // expected-error {{Unexpected token type!}}
}
OpenPOWER on IntegriCloud