diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2014-09-22 02:21:54 +0000 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2014-09-22 02:21:54 +0000 |
commit | 31097581aad843ffb85befeeedb2e23a4d8cc287 (patch) | |
tree | bb169eaa18a5fcf9baef086f133e1c6d2bafa80a /clang/test/CodeGen/ms-inline-asm.cpp | |
parent | db0e7061c6b45357f83b121d6b97f67104288993 (diff) | |
download | bcm5719-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/ms-inline-asm.cpp')
-rw-r--r-- | clang/test/CodeGen/ms-inline-asm.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGen/ms-inline-asm.cpp b/clang/test/CodeGen/ms-inline-asm.cpp index 65e59d6b947..03d971e698b 100644 --- a/clang/test/CodeGen/ms-inline-asm.cpp +++ b/clang/test/CodeGen/ms-inline-asm.cpp @@ -122,3 +122,20 @@ void t7_using() { // CHECK-LABEL: define void @_Z8t7_usingv // CHECK: call void asm sideeffect inteldialect "mov eax, [eax].4", "~{eax},~{dirflag},~{fpsr},~{flags}"() } + +void t8() { + __asm some_label: + // CHECK-LABEL: define void @_Z2t8v() + // CHECK: call void asm sideeffect inteldialect "L__MSASMLABEL_.1__some_label:", "~{dirflag},~{fpsr},~{flags}"() + struct A { + static void g() { + __asm jmp some_label ; This should jump forwards + __asm some_label: + __asm nop + // CHECK-LABEL: define internal void @_ZZ2t8vEN1A1gEv() + // CHECK: call void asm sideeffect inteldialect "jmp L__MSASMLABEL_.2__some_label\0A\09L__MSASMLABEL_.2__some_label:\0A\09nop", "~{dirflag},~{fpsr},~{flags}"() + } + }; + A::g(); +} + |