aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/ms-inline-asm.c
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-13 20:32:07 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-13 20:32:07 +0000
commit265f538b2c8b9e19196ce8a78a3da78671eb6f2b (patch)
treee55a0e00755c9ed0140287947874661d87d74b35 /test/CodeGen/ms-inline-asm.c
parent0d729105ecb50a7e3cbe6e57c29149edfa5cf05a (diff)
[ms-inline asm] Have patchMSAsmStrings() return a vector or AsmStrings.
The AsmParser expects a single asm instruction, but valid ms-style inline asm statements may contain multiple instructions. This happens with asm blocks __asm { mov ebx, eax mov ecx, ebx } or when multiple asm statements are adjacent to one another __asm mov ebx, eax __asm mov ecx, ebx and __asm mov ebx, eax __asm mov ecx, ebx Currently, asm blocks are not properly handled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161780 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ms-inline-asm.c')
-rw-r--r--test/CodeGen/ms-inline-asm.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGen/ms-inline-asm.c b/test/CodeGen/ms-inline-asm.c
index 67bef9c75f..8c3e5f7c56 100644
--- a/test/CodeGen/ms-inline-asm.c
+++ b/test/CodeGen/ms-inline-asm.c
@@ -6,3 +6,35 @@ void t1() {
// CHECK: ret void
__asm {}
}
+
+void t2() {
+// CHECK: @t2
+// CHECK: call void asm sideeffect "nop\0Anop\0Anop", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+// CHECK: ret void
+ __asm nop
+ __asm nop
+ __asm nop
+}
+
+void t3() {
+// CHECK: @t3
+// CHECK: call void asm sideeffect "nop\0Anop\0Anop", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+// CHECK: ret void
+ __asm nop __asm nop __asm nop
+}
+
+void t4(void) {
+// CHECK: @t4
+// CHECK: call void asm sideeffect "mov ebx, eax\0Amov ecx, ebx", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+// CHECK: ret void
+ __asm mov ebx, eax
+ __asm mov ecx, ebx
+}
+
+void t5(void) {
+// CHECK: @t5
+// CHECK: call void asm sideeffect "mov ebx, eax\0Amov ecx, ebx", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+// CHECK: ret void
+ __asm mov ebx, eax __asm mov ecx, ebx
+}
+