From: Chad Rosier Date: Thu, 17 Jan 2013 19:22:48 +0000 (+0000) Subject: [ms-inline asm] Updates and test case for r172743. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=205ecf01939d6e9c903f0e1d51455b2d882d076b;p=clang [ms-inline asm] Updates and test case for r172743. Part of rdar://12576868 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172744 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/ms-inline-asm.c b/test/CodeGen/ms-inline-asm.c index 5031722b01..9943fbb8cd 100644 --- a/test/CodeGen/ms-inline-asm.c +++ b/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/test/Sema/ms-inline-asm.c b/test/Sema/ms-inline-asm.c index 538d56ae66..4f6d689b7e 100644 --- a/test/Sema/ms-inline-asm.c +++ b/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!}} - } }