diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-04-01 18:34:21 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-04-01 18:34:21 +0000 |
commit | 101102711df0be1b15afb61c306503590b7e4936 (patch) | |
tree | 643a8766350b91669e7b5af7b296ee7e8b57ee00 /llvm/test/CodeGen/X86/segmented-stacks.ll | |
parent | 553751b9bc1cbd79f319bdd080777ce18c426671 (diff) | |
download | bcm5719-llvm-101102711df0be1b15afb61c306503590b7e4936.tar.gz bcm5719-llvm-101102711df0be1b15afb61c306503590b7e4936.zip |
Support segmented stacks on Win64
Identical to Win32 method except the GS segment register is used for TLS
instead of FS and pvArbitrary is at TEB offset 0x28 instead of 0x14.
llvm-svn: 205342
Diffstat (limited to 'llvm/test/CodeGen/X86/segmented-stacks.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/segmented-stacks.ll | 57 |
1 files changed, 54 insertions, 3 deletions
diff --git a/llvm/test/CodeGen/X86/segmented-stacks.ll b/llvm/test/CodeGen/X86/segmented-stacks.ll index 08a98ef51ec..c02152bb638 100644 --- a/llvm/test/CodeGen/X86/segmented-stacks.ll +++ b/llvm/test/CodeGen/X86/segmented-stacks.ll @@ -4,6 +4,7 @@ ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-darwin -segmented-stacks -verify-machineinstrs | FileCheck %s -check-prefix=X64-Darwin ; RUN: llc < %s -mcpu=generic -mtriple=i686-mingw32 -segmented-stacks -verify-machineinstrs | FileCheck %s -check-prefix=X32-MinGW ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-freebsd -segmented-stacks -verify-machineinstrs | FileCheck %s -check-prefix=X64-FreeBSD +; RUN: llc < %s -mcpu=generic -mtriple=x86_64-mingw32 -segmented-stacks -verify-machineinstrs | FileCheck %s -check-prefix=X64-MinGW ; We used to crash with filetype=obj ; RUN: llc < %s -mcpu=generic -mtriple=i686-linux -segmented-stacks -filetype=obj @@ -12,16 +13,14 @@ ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-darwin -segmented-stacks -filetype=obj ; RUN: llc < %s -mcpu=generic -mtriple=i686-mingw32 -segmented-stacks -filetype=obj ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-freebsd -segmented-stacks -filetype=obj +; RUN: llc < %s -mcpu=generic -mtriple=x86_64-mingw32 -segmented-stacks -filetype=obj ; RUN: not llc < %s -mcpu=generic -mtriple=x86_64-solaris -segmented-stacks 2> %t.log ; RUN: FileCheck %s -input-file=%t.log -check-prefix=X64-Solaris -; RUN: not llc < %s -mcpu=generic -mtriple=x86_64-mingw32 -segmented-stacks 2> %t.log -; RUN: FileCheck %s -input-file=%t.log -check-prefix=X64-MinGW ; RUN: not llc < %s -mcpu=generic -mtriple=i686-freebsd -segmented-stacks 2> %t.log ; RUN: FileCheck %s -input-file=%t.log -check-prefix=X32-FreeBSD ; X64-Solaris: Segmented stacks not supported on this platform -; X64-MinGW: Segmented stacks not supported on this platform ; X32-FreeBSD: Segmented stacks not supported on FreeBSD i386 ; Just to prevent the alloca from being optimized away @@ -83,6 +82,16 @@ define void @test_basic() { ; X32-MinGW-NEXT: calll ___morestack ; X32-MinGW-NEXT: ret +; X64-MinGW-LABEL: test_basic: + +; X64-MinGW: cmpq %gs:40, %rsp +; X64-MinGW-NEXT: ja .LBB0_2 + +; X64-MinGW: movabsq $72, %r10 +; X64-MinGW-NEXT: movabsq $32, %r11 +; X64-MinGW-NEXT: callq __morestack +; X64-MinGW-NEXT: retq + ; X64-FreeBSD-LABEL: test_basic: ; X64-FreeBSD: cmpq %fs:24, %rsp @@ -145,6 +154,17 @@ define i32 @test_nested(i32 * nest %closure, i32 %other) { ; X32-MinGW-NEXT: calll ___morestack ; X32-MinGW-NEXT: ret +; X64-MinGW-LABEL: test_nested: +; X64-MinGW: cmpq %gs:40, %rsp +; X64-MinGW-NEXT: ja .LBB1_2 + +; X64-MinGW: movq %r10, %rax +; X64-MinGW-NEXT: movabsq $0, %r10 +; X64-MinGW-NEXT: movabsq $32, %r11 +; X64-MinGW-NEXT: callq __morestack +; X64-MinGW-NEXT: retq +; X64-MinGW-NEXT: movq %rax, %r10 + ; X64-FreeBSD: cmpq %fs:24, %rsp ; X64-FreeBSD-NEXT: ja .LBB1_2 @@ -208,6 +228,16 @@ define void @test_large() { ; X32-MinGW-NEXT: calll ___morestack ; X32-MinGW-NEXT: ret +; X64-MinGW-LABEL: test_large: +; X64-MinGW: leaq -40040(%rsp), %r11 +; X64-MinGW-NEXT: cmpq %gs:40, %r11 +; X64-MinGW-NEXT: ja .LBB2_2 + +; X64-MinGW: movabsq $40040, %r10 +; X64-MinGW-NEXT: movabsq $32, %r11 +; X64-MinGW-NEXT: callq __morestack +; X64-MinGW-NEXT: retq + ; X64-FreeBSD: leaq -40008(%rsp), %r11 ; X64-FreeBSD-NEXT: cmpq %fs:24, %r11 ; X64-FreeBSD-NEXT: ja .LBB2_2 @@ -275,6 +305,16 @@ define fastcc void @test_fastcc() { ; X32-MinGW-NEXT: calll ___morestack ; X32-MinGW-NEXT: ret +; X64-MinGW-LABEL: test_fastcc: + +; X64-MinGW: cmpq %gs:40, %rsp +; X64-MinGW-NEXT: ja .LBB3_2 + +; X64-MinGW: movabsq $72, %r10 +; X64-MinGW-NEXT: movabsq $32, %r11 +; X64-MinGW-NEXT: callq __morestack +; X64-MinGW-NEXT: retq + ; X64-FreeBSD-LABEL: test_fastcc: ; X64-FreeBSD: cmpq %fs:24, %rsp @@ -348,6 +388,17 @@ define fastcc void @test_fastcc_large() { ; X32-MinGW-NEXT: calll ___morestack ; X32-MinGW-NEXT: ret +; X64-MinGW-LABEL: test_fastcc_large: + +; X64-MinGW: leaq -40040(%rsp), %r11 +; X64-MinGW-NEXT: cmpq %gs:40, %r11 +; X64-MinGW-NEXT: ja .LBB4_2 + +; X64-MinGW: movabsq $40040, %r10 +; X64-MinGW-NEXT: movabsq $32, %r11 +; X64-MinGW-NEXT: callq __morestack +; X64-MinGW-NEXT: retq + ; X64-FreeBSD-LABEL: test_fastcc_large: ; X64-FreeBSD: leaq -40008(%rsp), %r11 |