summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/mozilla-ms-inline-asm.c
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2014-09-22 02:21:54 +0000
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2014-09-22 02:21:54 +0000
commit31097581aad843ffb85befeeedb2e23a4d8cc287 (patch)
treebb169eaa18a5fcf9baef086f133e1c6d2bafa80a /clang/test/CodeGen/mozilla-ms-inline-asm.c
parentdb0e7061c6b45357f83b121d6b97f67104288993 (diff)
downloadbcm5719-llvm-31097581aad843ffb85befeeedb2e23a4d8cc287.tar.gz
bcm5719-llvm-31097581aad843ffb85befeeedb2e23a4d8cc287.zip
ms-inline-asm: Scope inline asm labels to functions
Summary: This fixes PR20023. In order to implement this scoping rule, we piggy back on the existing LabelDecl machinery, by creating LabelDecl's that will carry the "internal" name of the inline assembly label, which we will rewrite the asm label to. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4589 llvm-svn: 218230
Diffstat (limited to 'clang/test/CodeGen/mozilla-ms-inline-asm.c')
-rw-r--r--clang/test/CodeGen/mozilla-ms-inline-asm.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/clang/test/CodeGen/mozilla-ms-inline-asm.c b/clang/test/CodeGen/mozilla-ms-inline-asm.c
index 0f541d70fcd..b8b7a2d677d 100644
--- a/clang/test/CodeGen/mozilla-ms-inline-asm.c
+++ b/clang/test/CodeGen/mozilla-ms-inline-asm.c
@@ -3,6 +3,8 @@
// Some test cases for MS inline asm support from Mozilla code base.
+void invoke_copy_to_stack() {}
+
void invoke(void* that, unsigned methodIndex,
unsigned paramCount, void* params)
{
@@ -18,24 +20,25 @@ void invoke(void* that, unsigned methodIndex,
// CHECK: call void asm sideeffect inteldialect
// CHECK: mov edx,dword ptr $1
// CHECK: test edx,edx
-// CHECK: jz noparams
+// CHECK: jz {{[^_]*}}__MSASMLABEL_.0__noparams
+// ^ Can't use {{.*}} here because the matching is greedy.
// CHECK: mov eax,edx
// CHECK: shl eax,$$3
// CHECK: sub esp,eax
// CHECK: mov ecx,esp
// CHECK: push dword ptr $0
-// CHECK: call invoke_copy_to_stack
-// CHECK: noparams:
-// CHECK: mov ecx,dword ptr $2
+// CHECK: call dword ptr $2
+// CHECK: {{.*}}__MSASMLABEL_.0__noparams:
+// CHECK: mov ecx,dword ptr $3
// CHECK: push ecx
// CHECK: mov edx,[ecx]
-// CHECK: mov eax,dword ptr $3
+// CHECK: mov eax,dword ptr $4
// CHECK: call dword ptr[edx+eax*$$4]
// CHECK: mov esp,ebp
// CHECK: pop ebp
// CHECK: ret
-// CHECK: "=*m,*m,*m,*m,~{eax},~{ebp},~{ecx},~{edx},~{flags},~{esp},~{dirflag},~{fpsr},~{flags}"
-// CHECK: (i8** %8, i32* %7, i8** %5, i32* %6)
+// CHECK: "=*m,*m,*m,*m,*m,~{eax},~{ebp},~{ecx},~{edx},~{flags},~{esp},~{dirflag},~{fpsr},~{flags}"
+// CHECK: (i8** %8, i32* %7, void (...)* bitcast (void ()* @invoke_copy_to_stack to void (...)*), i8** %5, i32* %6)
// CHECK: ret void
__asm {
mov edx,paramCount
OpenPOWER on IntegriCloud