summaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-12-10 05:31:27 +0000
committerReid Kleckner <reid@kleckner.net>2013-12-10 05:31:27 +0000
commitcc8d39acf5b16939d656ea8b6d755738bc3266d0 (patch)
treeac2b4dc2c9bebaf2286b995da954267ba58ecee3 /test/CodeGen
parentec4d326aad404fa7a6335aadcc21710ecc6a63b0 (diff)
downloadllvm-cc8d39acf5b16939d656ea8b6d755738bc3266d0.tar.gz
llvm-cc8d39acf5b16939d656ea8b6d755738bc3266d0.tar.bz2
llvm-cc8d39acf5b16939d656ea8b6d755738bc3266d0.tar.xz
Revert "Fix miscompile of MS inline assembly with stack realignment"
This reverts commit r196876. Its tests failed on the bots, so I'll figure it out tomorrow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196879 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/inline-asm-stack-realign.ll16
-rw-r--r--test/CodeGen/X86/inline-asm-stack-realign2.ll15
-rw-r--r--test/CodeGen/X86/ms-inline-asm.ll33
3 files changed, 8 insertions, 56 deletions
diff --git a/test/CodeGen/X86/inline-asm-stack-realign.ll b/test/CodeGen/X86/inline-asm-stack-realign.ll
deleted file mode 100644
index 5cf0627763..0000000000
--- a/test/CodeGen/X86/inline-asm-stack-realign.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: not llc -march x86 < %s 2>&1 | FileCheck %s
-
-; We don't currently support realigning the stack and adjusting the stack
-; pointer in inline asm. This commonly happens in MS inline assembly using
-; push and pop.
-
-; CHECK: Stack realignment in presence of dynamic stack adjustments is not supported with inline assembly
-
-define i32 @foo() {
-entry:
- %r = alloca i32, align 16
- store i32 -1, i32* %r, align 16
- call void asm sideeffect inteldialect "push esi\0A\09xor esi, esi\0A\09mov dword ptr $0, esi\0A\09pop esi", "=*m,~{flags},~{esi},~{esp},~{dirflag},~{fpsr},~{flags}"(i32* %r)
- %0 = load i32* %r, align 16
- ret i32 %0
-}
diff --git a/test/CodeGen/X86/inline-asm-stack-realign2.ll b/test/CodeGen/X86/inline-asm-stack-realign2.ll
deleted file mode 100644
index fa18258172..0000000000
--- a/test/CodeGen/X86/inline-asm-stack-realign2.ll
+++ /dev/null
@@ -1,15 +0,0 @@
-; RUN: not llc -march x86 < %s 2>&1 | FileCheck %s
-
-; We don't currently support realigning the stack and adjusting the stack
-; pointer in inline asm. This can even happen in GNU asm.
-
-; CHECK: Stack realignment in presence of dynamic stack adjustments is not supported with inline assembly
-
-define i32 @foo() {
-entry:
- %r = alloca i32, align 16
- store i32 -1, i32* %r, align 16
- call void asm sideeffect "push %esi\0A\09xor %esi, %esi\0A\09mov %esi, $0\0A\09pop %esi", "=*m,~{flags},~{esi},~{esp},~{dirflag},~{fpsr},~{flags}"(i32* %r)
- %0 = load i32* %r, align 16
- ret i32 %0
-}
diff --git a/test/CodeGen/X86/ms-inline-asm.ll b/test/CodeGen/X86/ms-inline-asm.ll
index 779abfeeea..5e7ba37b39 100644
--- a/test/CodeGen/X86/ms-inline-asm.ll
+++ b/test/CodeGen/X86/ms-inline-asm.ll
@@ -5,6 +5,7 @@ entry:
%0 = tail call i32 asm sideeffect inteldialect "mov eax, $1\0A\09mov $0, eax", "=r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 1) nounwind
ret i32 %0
; CHECK: t1
+; CHECK: movl %esp, %ebp
; CHECK: {{## InlineAsm Start|#APP}}
; CHECK: .intel_syntax
; CHECK: mov eax, ecx
@@ -18,6 +19,7 @@ entry:
call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
ret void
; CHECK: t2
+; CHECK: movl %esp, %ebp
; CHECK: {{## InlineAsm Start|#APP}}
; CHECK: .intel_syntax
; CHECK: mov eax, 1
@@ -32,6 +34,7 @@ entry:
call void asm sideeffect inteldialect "mov eax, DWORD PTR [$0]", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %V.addr) nounwind
ret void
; CHECK: t3
+; CHECK: movl %esp, %ebp
; CHECK: {{## InlineAsm Start|#APP}}
; CHECK: .intel_syntax
; CHECK: mov eax, DWORD PTR {{[[esp]}}
@@ -53,6 +56,7 @@ entry:
%0 = load i32* %b1, align 4
ret i32 %0
; CHECK: t18
+; CHECK: movl %esp, %ebp
; CHECK: {{## InlineAsm Start|#APP}}
; CHECK: .intel_syntax
; CHECK: lea ebx, foo
@@ -72,6 +76,7 @@ entry:
call void asm sideeffect inteldialect "call $0", "r,~{dirflag},~{fpsr},~{flags}"(void ()* @t19_helper) nounwind
ret void
; CHECK-LABEL: t19:
+; CHECK: movl %esp, %ebp
; CHECK: movl ${{_?}}t19_helper, %eax
; CHECK: {{## InlineAsm Start|#APP}}
; CHECK: .intel_syntax
@@ -90,6 +95,7 @@ entry:
%0 = load i32** %res, align 4
ret i32* %0
; CHECK-LABEL: t30:
+; CHECK: movl %esp, %ebp
; CHECK: {{## InlineAsm Start|#APP}}
; CHECK: .intel_syntax
; CHECK: lea edi, dword ptr [{{_?}}results]
@@ -97,31 +103,8 @@ entry:
; CHECK: {{## InlineAsm End|#NO_APP}}
; CHECK: {{## InlineAsm Start|#APP}}
; CHECK: .intel_syntax
-; CHECK: mov dword ptr [esp], edi
-; CHECK: .att_syntax
-; CHECK: {{## InlineAsm End|#NO_APP}}
-; CHECK: movl (%esp), %eax
-}
-
-; Stack realignment plus MS inline asm that does *not* adjust the stack is no
-; longer an error.
-
-define i32 @t31() {
-entry:
- %val = alloca i32, align 16
- store i32 -1, i32* %val, align 16
- call void asm sideeffect inteldialect "mov dword ptr $0, esp", "=*m,~{dirflag},~{fpsr},~{flags}"(i32* %val) #1
- %sp = load i32* %val, align 16
- ret i32 %sp
-; CHECK-LABEL: t31:
-; CHECK: pushl %ebp
-; CHECK: movl %esp, %ebp
-; CHECK: andl $-16, %esp
-; CHECK: {{## InlineAsm Start|#APP}}
-; CHECK: .intel_syntax
-; CHECK: mov dword ptr [esp], esp
+; CHECK: mov dword ptr [esi], edi
; CHECK: .att_syntax
; CHECK: {{## InlineAsm End|#NO_APP}}
-; CHECK: movl (%esp), %eax
-; CHECK: ret
+; CHECK: movl (%esi), %eax
}