summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-01-12 20:22:08 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-01-12 20:22:08 +0000
commit10745d3381c9142ea75aba2c85b41ff57c1de4c9 (patch)
treed000954c05dda6345e46a6f197ae254ab407af3e /llvm/test
parentb04a09a515e5fc7ab06941104166c3676d12cdc2 (diff)
downloadbcm5719-llvm-10745d3381c9142ea75aba2c85b41ff57c1de4c9.tar.gz
bcm5719-llvm-10745d3381c9142ea75aba2c85b41ff57c1de4c9.zip
Support segmented stacks on win32.
Uses the pvArbitrary slot of the TIB, which is reserved for applications. We only support frames with a static size. llvm-svn: 148040
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/segmented-stacks.ll50
1 files changed, 50 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/segmented-stacks.ll b/llvm/test/CodeGen/X86/segmented-stacks.ll
index 6e91d00ac6d..4c4c542785e 100644
--- a/llvm/test/CodeGen/X86/segmented-stacks.ll
+++ b/llvm/test/CodeGen/X86/segmented-stacks.ll
@@ -2,12 +2,14 @@
; RUN: llc < %s -mtriple=x86_64-linux -segmented-stacks -verify-machineinstrs | FileCheck %s -check-prefix=X64-Linux
; RUN: llc < %s -mtriple=i686-darwin -segmented-stacks -verify-machineinstrs | FileCheck %s -check-prefix=X32-Darwin
; RUN: llc < %s -mtriple=x86_64-darwin -segmented-stacks -verify-machineinstrs | FileCheck %s -check-prefix=X64-Darwin
+; RUN: llc < %s -mtriple=i686-mingw32 -segmented-stacks -verify-machineinstrs | FileCheck %s -check-prefix=X32-MinGW
; We used to crash with filetype=obj
; RUN: llc < %s -mtriple=i686-linux -segmented-stacks -filetype=obj
; RUN: llc < %s -mtriple=x86_64-linux -segmented-stacks -filetype=obj
; RUN: llc < %s -mtriple=i686-darwin -segmented-stacks -filetype=obj
; RUN: llc < %s -mtriple=x86_64-darwin -segmented-stacks -filetype=obj
+; RUN: llc < %s -mtriple=i686-mingw32 -segmented-stacks -filetype=obj
; Just to prevent the alloca from being optimized away
declare void @dummy_use(i32*, i32)
@@ -58,6 +60,16 @@ define void @test_basic() {
; X64-Darwin-NEXT: callq ___morestack
; X64-Darwin-NEXT: ret
+; X32-MinGW: test_basic:
+
+; X32-MinGW: cmpl %fs:20, %esp
+; X32-MinGW-NEXT: ja LBB0_2
+
+; X32-MinGW: pushl $0
+; X32-MinGW-NEXT: pushl $48
+; X32-MinGW-NEXT: calll ___morestack
+; X32-MinGW-NEXT: ret
+
}
define i32 @test_nested(i32 * nest %closure, i32 %other) {
@@ -102,6 +114,14 @@ define i32 @test_nested(i32 * nest %closure, i32 %other) {
; X64-Darwin-NEXT: ret
; X64-Darwin-NEXT: movq %rax, %r10
+; X32-MinGW: cmpl %fs:20, %esp
+; X32-MinGW-NEXT: ja LBB1_2
+
+; X32-MinGW: pushl $4
+; X32-MinGW-NEXT: pushl $0
+; X32-MinGW-NEXT: calll ___morestack
+; X32-MinGW-NEXT: ret
+
}
define void @test_large() {
@@ -146,6 +166,15 @@ define void @test_large() {
; X64-Darwin-NEXT: callq ___morestack
; X64-Darwin-NEXT: ret
+; X32-MinGW: leal -40008(%esp), %ecx
+; X32-MinGW-NEXT: cmpl %fs:20, %ecx
+; X32-MinGW-NEXT: ja LBB2_2
+
+; X32-MinGW: pushl $0
+; X32-MinGW-NEXT: pushl $40008
+; X32-MinGW-NEXT: calll ___morestack
+; X32-MinGW-NEXT: ret
+
}
define fastcc void @test_fastcc() {
@@ -194,6 +223,16 @@ define fastcc void @test_fastcc() {
; X64-Darwin-NEXT: callq ___morestack
; X64-Darwin-NEXT: ret
+; X32-MinGW: test_fastcc:
+
+; X32-MinGW: cmpl %fs:20, %esp
+; X32-MinGW-NEXT: ja LBB3_2
+
+; X32-MinGW: pushl $0
+; X32-MinGW-NEXT: pushl $48
+; X32-MinGW-NEXT: calll ___morestack
+; X32-MinGW-NEXT: ret
+
}
define fastcc void @test_fastcc_large() {
@@ -246,6 +285,17 @@ define fastcc void @test_fastcc_large() {
; X64-Darwin-NEXT: callq ___morestack
; X64-Darwin-NEXT: ret
+; X32-MinGW: test_fastcc_large:
+
+; X32-MinGW: leal -40008(%esp), %eax
+; X32-MinGW-NEXT: cmpl %fs:20, %eax
+; X32-MinGW-NEXT: ja LBB4_2
+
+; X32-MinGW: pushl $0
+; X32-MinGW-NEXT: pushl $40008
+; X32-MinGW-NEXT: calll ___morestack
+; X32-MinGW-NEXT: ret
+
}
define fastcc void @test_fastcc_large_with_ecx_arg(i32 %a) {
OpenPOWER on IntegriCloud