summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-01-17 19:22:48 +0000
committerChad Rosier <mcrosier@apple.com>2013-01-17 19:22:48 +0000
commite343bc83f014e4d7092799f0d65d309f08e1aa5c (patch)
tree6358ccaab476fec383e034f43097b5618e8826e5 /clang
parentd0ed73acb4d63009ed6b3d142244dd310cbebece (diff)
downloadbcm5719-llvm-e343bc83f014e4d7092799f0d65d309f08e1aa5c.tar.gz
bcm5719-llvm-e343bc83f014e4d7092799f0d65d309f08e1aa5c.zip
[ms-inline asm] Updates and test case for r172743.
Part of rdar://12576868 llvm-svn: 172744
Diffstat (limited to 'clang')
-rw-r--r--clang/test/CodeGen/ms-inline-asm.c30
-rw-r--r--clang/test/Sema/ms-inline-asm.c16
2 files changed, 29 insertions, 17 deletions
diff --git a/clang/test/CodeGen/ms-inline-asm.c b/clang/test/CodeGen/ms-inline-asm.c
index 5031722b01c..9943fbb8cd3 100644
--- a/clang/test/CodeGen/ms-inline-asm.c
+++ b/clang/test/CodeGen/ms-inline-asm.c
@@ -198,10 +198,38 @@ int t19() {
}
void t20() {
+ char bar;
int foo;
- __asm mov eax, TYPE foo
+ char _bar[2];
+ int _foo[4];
+
+ __asm mov eax, LENGTH foo
+ __asm mov eax, LENGTH bar
+ __asm mov eax, LENGTH _foo
+ __asm mov eax, LENGTH _bar
// CHECK: t20
+// CHECK: call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect "mov eax, $$4", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect "mov eax, $$2", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
+
+ __asm mov eax, TYPE foo
+ __asm mov eax, TYPE bar
+ __asm mov eax, TYPE _foo
+ __asm mov eax, TYPE _bar
// CHECK: call void asm sideeffect inteldialect "mov eax, $$4", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect "mov eax, $$4", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
+
+ __asm mov eax, SIZE foo
+ __asm mov eax, SIZE bar
+ __asm mov eax, SIZE _foo
+ __asm mov eax, SIZE _bar
+// CHECK: call void asm sideeffect inteldialect "mov eax, $$4", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect "mov eax, $$16", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect inteldialect "mov eax, $$2", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
}
void t21() {
diff --git a/clang/test/Sema/ms-inline-asm.c b/clang/test/Sema/ms-inline-asm.c
index 538d56ae66e..4f6d689b7e0 100644
--- a/clang/test/Sema/ms-inline-asm.c
+++ b/clang/test/Sema/ms-inline-asm.c
@@ -19,20 +19,4 @@ void f() {
__asm {
mov eax, 1+++ // expected-error 2 {{unknown token in expression}}
}
- f();
- __asm {
- mov eax, TYPE cat // expected-error {{Unable to lookup TYPE of expr!}}
- }
- f();
- __asm {
- mov eax, SIZE foo // expected-error {{Unsupported directive!}}
- }
- f();
- __asm {
- mov eax, LENGTH foo // expected-error {{Unsupported directive!}}
- }
- f();
- __asm {
- mov eax, TYPE bar // expected-error {{Unable to lookup TYPE of expr!}}
- }
}
OpenPOWER on IntegriCloud