2014-04-11 06:58:43 +08:00
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=i686-linux -verify-machineinstrs | FileCheck %s -check-prefix=X32-Linux
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux -verify-machineinstrs | FileCheck %s -check-prefix=X64-Linux
|
2014-12-31 04:05:19 +08:00
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux -code-model=large -verify-machineinstrs | FileCheck %s -check-prefix=X64-Linux-Large
|
2014-09-22 21:11:35 +08:00
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnux32 -verify-machineinstrs | FileCheck %s -check-prefix=X32ABI
|
2014-04-11 06:58:43 +08:00
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=i686-darwin -verify-machineinstrs | FileCheck %s -check-prefix=X32-Darwin
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-darwin -verify-machineinstrs | FileCheck %s -check-prefix=X64-Darwin
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=i686-mingw32 -verify-machineinstrs | FileCheck %s -check-prefix=X32-MinGW
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-freebsd -verify-machineinstrs | FileCheck %s -check-prefix=X64-FreeBSD
|
2014-12-29 23:47:28 +08:00
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=i686-dragonfly -verify-machineinstrs | FileCheck %s -check-prefix=X32-DFlyBSD
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-dragonfly -verify-machineinstrs | FileCheck %s -check-prefix=X64-DFlyBSD
|
2014-04-11 06:58:43 +08:00
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-mingw32 -verify-machineinstrs | FileCheck %s -check-prefix=X64-MinGW
|
2011-08-31 03:51:29 +08:00
|
|
|
|
2012-01-12 02:14:03 +08:00
|
|
|
; We used to crash with filetype=obj
|
2015-04-11 03:36:55 +08:00
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=i686-linux -filetype=obj -o /dev/null
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux -filetype=obj -o /dev/null
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnux32 -filetype=obj -o /dev/null
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=i686-darwin -filetype=obj -o /dev/null
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-darwin -filetype=obj -o /dev/null
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=i686-mingw32 -filetype=obj -o /dev/null
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-freebsd -filetype=obj -o /dev/null
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=i686-dragonfly -filetype=obj -o /dev/null
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-dragonfly -filetype=obj -o /dev/null
|
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-mingw32 -filetype=obj -o /dev/null
|
2014-04-11 06:58:43 +08:00
|
|
|
|
|
|
|
; RUN: not llc < %s -mcpu=generic -mtriple=x86_64-solaris 2> %t.log
|
2012-01-13 04:26:13 +08:00
|
|
|
; RUN: FileCheck %s -input-file=%t.log -check-prefix=X64-Solaris
|
2014-04-11 06:58:43 +08:00
|
|
|
; RUN: not llc < %s -mcpu=generic -mtriple=i686-freebsd 2> %t.log
|
2012-01-13 04:26:13 +08:00
|
|
|
; RUN: FileCheck %s -input-file=%t.log -check-prefix=X32-FreeBSD
|
|
|
|
|
|
|
|
; X64-Solaris: Segmented stacks not supported on this platform
|
|
|
|
; X32-FreeBSD: Segmented stacks not supported on FreeBSD i386
|
|
|
|
|
2011-08-31 03:51:29 +08:00
|
|
|
; Just to prevent the alloca from being optimized away
|
|
|
|
declare void @dummy_use(i32*, i32)
|
|
|
|
|
2014-04-11 06:58:43 +08:00
|
|
|
define void @test_basic() #0 {
|
2012-01-12 02:51:03 +08:00
|
|
|
%mem = alloca i32, i32 10
|
|
|
|
call void @dummy_use (i32* %mem, i32 10)
|
|
|
|
ret void
|
2011-08-31 03:51:29 +08:00
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-Linux-LABEL: test_basic:
|
2011-08-31 03:51:29 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Linux: cmpl %gs:48, %esp
|
|
|
|
; X32-Linux-NEXT: ja .LBB0_2
|
2011-08-31 03:51:29 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Linux: pushl $0
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-Linux-NEXT: pushl $44
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Linux-NEXT: calll __morestack
|
|
|
|
; X32-Linux-NEXT: ret
|
2011-08-31 03:51:29 +08:00
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X64-Linux-LABEL: test_basic:
|
2011-08-31 03:51:29 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X64-Linux: cmpq %fs:112, %rsp
|
|
|
|
; X64-Linux-NEXT: ja .LBB0_2
|
2011-08-31 03:51:29 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X64-Linux: movabsq $40, %r10
|
|
|
|
; X64-Linux-NEXT: movabsq $0, %r11
|
|
|
|
; X64-Linux-NEXT: callq __morestack
|
|
|
|
; X64-Linux-NEXT: ret
|
|
|
|
|
2014-12-31 04:05:19 +08:00
|
|
|
; X64-Linux-Large-LABEL: test_basic:
|
|
|
|
|
|
|
|
; X64-Linux-Large: cmpq %fs:112, %rsp
|
|
|
|
; X64-Linux-Large-NEXT: ja .LBB0_2
|
|
|
|
|
|
|
|
; X64-Linux-Large: movabsq $40, %r10
|
|
|
|
; X64-Linux-Large-NEXT: movabsq $0, %r11
|
|
|
|
; X64-Linux-Large-NEXT: callq *__morestack_addr(%rip)
|
|
|
|
; X64-Linux-Large-NEXT: ret
|
|
|
|
|
2014-09-22 21:11:35 +08:00
|
|
|
; X32ABI-LABEL: test_basic:
|
|
|
|
|
|
|
|
; X32ABI: cmpl %fs:64, %esp
|
|
|
|
; X32ABI-NEXT: ja .LBB0_2
|
|
|
|
|
|
|
|
; X32ABI: movl $40, %r10d
|
|
|
|
; X32ABI-NEXT: movl $0, %r11d
|
|
|
|
; X32ABI-NEXT: callq __morestack
|
|
|
|
; X32ABI-NEXT: ret
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-Darwin-LABEL: test_basic:
|
2012-01-12 03:00:37 +08:00
|
|
|
|
|
|
|
; X32-Darwin: movl $432, %ecx
|
|
|
|
; X32-Darwin-NEXT: cmpl %gs:(%ecx), %esp
|
|
|
|
; X32-Darwin-NEXT: ja LBB0_2
|
|
|
|
|
|
|
|
; X32-Darwin: pushl $0
|
|
|
|
; X32-Darwin-NEXT: pushl $60
|
|
|
|
; X32-Darwin-NEXT: calll ___morestack
|
|
|
|
; X32-Darwin-NEXT: ret
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X64-Darwin-LABEL: test_basic:
|
2012-01-12 03:00:37 +08:00
|
|
|
|
|
|
|
; X64-Darwin: cmpq %gs:816, %rsp
|
|
|
|
; X64-Darwin-NEXT: ja LBB0_2
|
|
|
|
|
|
|
|
; X64-Darwin: movabsq $40, %r10
|
|
|
|
; X64-Darwin-NEXT: movabsq $0, %r11
|
|
|
|
; X64-Darwin-NEXT: callq ___morestack
|
|
|
|
; X64-Darwin-NEXT: ret
|
2011-08-31 03:51:29 +08:00
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-MinGW-LABEL: test_basic:
|
2012-01-13 04:22:08 +08:00
|
|
|
|
|
|
|
; X32-MinGW: cmpl %fs:20, %esp
|
|
|
|
; X32-MinGW-NEXT: ja LBB0_2
|
|
|
|
|
|
|
|
; X32-MinGW: pushl $0
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-MinGW-NEXT: pushl $40
|
2012-01-13 04:22:08 +08:00
|
|
|
; X32-MinGW-NEXT: calll ___morestack
|
|
|
|
; X32-MinGW-NEXT: ret
|
|
|
|
|
2014-04-02 02:34:21 +08:00
|
|
|
; 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
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X64-FreeBSD-LABEL: test_basic:
|
2012-01-13 04:24:30 +08:00
|
|
|
|
|
|
|
; X64-FreeBSD: cmpq %fs:24, %rsp
|
|
|
|
; X64-FreeBSD-NEXT: ja .LBB0_2
|
|
|
|
|
|
|
|
; X64-FreeBSD: movabsq $40, %r10
|
|
|
|
; X64-FreeBSD-NEXT: movabsq $0, %r11
|
|
|
|
; X64-FreeBSD-NEXT: callq __morestack
|
|
|
|
; X64-FreeBSD-NEXT: ret
|
|
|
|
|
2014-12-29 23:47:28 +08:00
|
|
|
; X32-DFlyBSD-LABEL: test_basic:
|
|
|
|
|
|
|
|
; X32-DFlyBSD: cmpl %fs:16, %esp
|
|
|
|
; X32-DFlyBSD-NEXT: ja .LBB0_2
|
|
|
|
|
|
|
|
; X32-DFlyBSD: pushl $0
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-DFlyBSD-NEXT: pushl $40
|
2014-12-29 23:47:28 +08:00
|
|
|
; X32-DFlyBSD-NEXT: calll __morestack
|
|
|
|
; X32-DFlyBSD-NEXT: ret
|
|
|
|
|
|
|
|
; X64-DFlyBSD-LABEL: test_basic:
|
|
|
|
|
|
|
|
; X64-DFlyBSD: cmpq %fs:32, %rsp
|
|
|
|
; X64-DFlyBSD-NEXT: ja .LBB0_2
|
|
|
|
|
|
|
|
; X64-DFlyBSD: movabsq $40, %r10
|
|
|
|
; X64-DFlyBSD-NEXT: movabsq $0, %r11
|
|
|
|
; X64-DFlyBSD-NEXT: callq __morestack
|
|
|
|
; X64-DFlyBSD-NEXT: ret
|
|
|
|
|
2011-08-31 03:51:29 +08:00
|
|
|
}
|
|
|
|
|
2014-04-11 06:58:43 +08:00
|
|
|
define i32 @test_nested(i32 * nest %closure, i32 %other) #0 {
|
2015-02-28 05:17:42 +08:00
|
|
|
%addend = load i32 , i32 * %closure
|
2011-08-31 03:51:29 +08:00
|
|
|
%result = add i32 %other, %addend
|
2014-05-22 21:03:43 +08:00
|
|
|
%mem = alloca i32, i32 10
|
|
|
|
call void @dummy_use (i32* %mem, i32 10)
|
2011-08-31 03:51:29 +08:00
|
|
|
ret i32 %result
|
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Linux: cmpl %gs:48, %esp
|
|
|
|
; X32-Linux-NEXT: ja .LBB1_2
|
|
|
|
|
|
|
|
; X32-Linux: pushl $4
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-Linux-NEXT: pushl $44
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Linux-NEXT: calll __morestack
|
|
|
|
; X32-Linux-NEXT: ret
|
|
|
|
|
|
|
|
; X64-Linux: cmpq %fs:112, %rsp
|
|
|
|
; X64-Linux-NEXT: ja .LBB1_2
|
|
|
|
|
|
|
|
; X64-Linux: movq %r10, %rax
|
2014-05-22 21:03:43 +08:00
|
|
|
; X64-Linux-NEXT: movabsq $56, %r10
|
2012-01-12 03:00:37 +08:00
|
|
|
; X64-Linux-NEXT: movabsq $0, %r11
|
|
|
|
; X64-Linux-NEXT: callq __morestack
|
|
|
|
; X64-Linux-NEXT: ret
|
|
|
|
; X64-Linux-NEXT: movq %rax, %r10
|
2011-08-31 03:51:29 +08:00
|
|
|
|
2014-09-22 21:11:35 +08:00
|
|
|
; X32ABI: cmpl %fs:64, %esp
|
|
|
|
; X32ABI-NEXT: ja .LBB1_2
|
|
|
|
|
|
|
|
; X32ABI: movl %r10d, %eax
|
|
|
|
; X32ABI-NEXT: movl $56, %r10d
|
|
|
|
; X32ABI-NEXT: movl $0, %r11d
|
|
|
|
; X32ABI-NEXT: callq __morestack
|
|
|
|
; X32ABI-NEXT: ret
|
|
|
|
; X32ABI-NEXT: movq %rax, %r10
|
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Darwin: movl $432, %edx
|
|
|
|
; X32-Darwin-NEXT: cmpl %gs:(%edx), %esp
|
|
|
|
; X32-Darwin-NEXT: ja LBB1_2
|
2011-08-31 03:51:29 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Darwin: pushl $4
|
2014-05-22 21:03:43 +08:00
|
|
|
; X32-Darwin-NEXT: pushl $60
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Darwin-NEXT: calll ___morestack
|
|
|
|
; X32-Darwin-NEXT: ret
|
2011-08-31 03:51:29 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X64-Darwin: cmpq %gs:816, %rsp
|
|
|
|
; X64-Darwin-NEXT: ja LBB1_2
|
|
|
|
|
|
|
|
; X64-Darwin: movq %r10, %rax
|
2014-05-22 21:03:43 +08:00
|
|
|
; X64-Darwin-NEXT: movabsq $56, %r10
|
2012-01-12 03:00:37 +08:00
|
|
|
; X64-Darwin-NEXT: movabsq $0, %r11
|
|
|
|
; X64-Darwin-NEXT: callq ___morestack
|
|
|
|
; X64-Darwin-NEXT: ret
|
|
|
|
; X64-Darwin-NEXT: movq %rax, %r10
|
2011-08-31 03:51:29 +08:00
|
|
|
|
2012-01-13 04:22:08 +08:00
|
|
|
; X32-MinGW: cmpl %fs:20, %esp
|
|
|
|
; X32-MinGW-NEXT: ja LBB1_2
|
|
|
|
|
|
|
|
; X32-MinGW: pushl $4
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-MinGW-NEXT: pushl $44
|
2012-01-13 04:22:08 +08:00
|
|
|
; X32-MinGW-NEXT: calll ___morestack
|
|
|
|
; X32-MinGW-NEXT: ret
|
|
|
|
|
2014-04-02 02:34:21 +08:00
|
|
|
; X64-MinGW-LABEL: test_nested:
|
|
|
|
; X64-MinGW: cmpq %gs:40, %rsp
|
|
|
|
; X64-MinGW-NEXT: ja .LBB1_2
|
|
|
|
|
|
|
|
; X64-MinGW: movq %r10, %rax
|
2014-05-22 21:03:43 +08:00
|
|
|
; X64-MinGW-NEXT: movabsq $88, %r10
|
2014-04-02 02:34:21 +08:00
|
|
|
; X64-MinGW-NEXT: movabsq $32, %r11
|
|
|
|
; X64-MinGW-NEXT: callq __morestack
|
|
|
|
; X64-MinGW-NEXT: retq
|
|
|
|
; X64-MinGW-NEXT: movq %rax, %r10
|
|
|
|
|
2012-01-13 04:24:30 +08:00
|
|
|
; X64-FreeBSD: cmpq %fs:24, %rsp
|
|
|
|
; X64-FreeBSD-NEXT: ja .LBB1_2
|
|
|
|
|
|
|
|
; X64-FreeBSD: movq %r10, %rax
|
2014-05-22 21:03:43 +08:00
|
|
|
; X64-FreeBSD-NEXT: movabsq $56, %r10
|
2012-01-13 04:24:30 +08:00
|
|
|
; X64-FreeBSD-NEXT: movabsq $0, %r11
|
|
|
|
; X64-FreeBSD-NEXT: callq __morestack
|
|
|
|
; X64-FreeBSD-NEXT: ret
|
|
|
|
; X64-FreeBSD-NEXT: movq %rax, %r10
|
|
|
|
|
2014-12-29 23:47:28 +08:00
|
|
|
; X32-DFlyBSD: cmpl %fs:16, %esp
|
|
|
|
; X32-DFlyBSD-NEXT: ja .LBB1_2
|
|
|
|
|
|
|
|
; X32-DFlyBSD: pushl $4
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-DFlyBSD-NEXT: pushl $44
|
2014-12-29 23:47:28 +08:00
|
|
|
; X32-DFlyBSD-NEXT: calll __morestack
|
|
|
|
; X32-DFlyBSD-NEXT: ret
|
|
|
|
|
|
|
|
; X64-DFlyBSD: cmpq %fs:32, %rsp
|
|
|
|
; X64-DFlyBSD-NEXT: ja .LBB1_2
|
|
|
|
|
|
|
|
; X64-DFlyBSD: movq %r10, %rax
|
|
|
|
; X64-DFlyBSD-NEXT: movabsq $56, %r10
|
|
|
|
; X64-DFlyBSD-NEXT: movabsq $0, %r11
|
|
|
|
; X64-DFlyBSD-NEXT: callq __morestack
|
|
|
|
; X64-DFlyBSD-NEXT: ret
|
|
|
|
; X64-DFlyBSD-NEXT: movq %rax, %r10
|
|
|
|
|
2011-08-31 03:51:29 +08:00
|
|
|
}
|
2011-12-03 17:32:07 +08:00
|
|
|
|
2014-04-11 06:58:43 +08:00
|
|
|
define void @test_large() #0 {
|
2011-12-03 17:32:07 +08:00
|
|
|
%mem = alloca i32, i32 10000
|
|
|
|
call void @dummy_use (i32* %mem, i32 0)
|
|
|
|
ret void
|
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Linux: leal -40012(%esp), %ecx
|
|
|
|
; X32-Linux-NEXT: cmpl %gs:48, %ecx
|
|
|
|
; X32-Linux-NEXT: ja .LBB2_2
|
|
|
|
|
|
|
|
; X32-Linux: pushl $0
|
|
|
|
; X32-Linux-NEXT: pushl $40012
|
|
|
|
; X32-Linux-NEXT: calll __morestack
|
|
|
|
; X32-Linux-NEXT: ret
|
|
|
|
|
|
|
|
; X64-Linux: leaq -40008(%rsp), %r11
|
|
|
|
; X64-Linux-NEXT: cmpq %fs:112, %r11
|
|
|
|
; X64-Linux-NEXT: ja .LBB2_2
|
|
|
|
|
|
|
|
; X64-Linux: movabsq $40008, %r10
|
|
|
|
; X64-Linux-NEXT: movabsq $0, %r11
|
|
|
|
; X64-Linux-NEXT: callq __morestack
|
|
|
|
; X64-Linux-NEXT: ret
|
|
|
|
|
2014-09-22 21:11:35 +08:00
|
|
|
; X32ABI: leal -40008(%rsp), %r11d
|
|
|
|
; X32ABI-NEXT: cmpl %fs:64, %r11d
|
|
|
|
; X32ABI-NEXT: ja .LBB2_2
|
|
|
|
|
|
|
|
; X32ABI: movl $40008, %r10d
|
|
|
|
; X32ABI-NEXT: movl $0, %r11d
|
|
|
|
; X32ABI-NEXT: callq __morestack
|
|
|
|
; X32ABI-NEXT: ret
|
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Darwin: leal -40012(%esp), %ecx
|
|
|
|
; X32-Darwin-NEXT: movl $432, %eax
|
|
|
|
; X32-Darwin-NEXT: cmpl %gs:(%eax), %ecx
|
|
|
|
; X32-Darwin-NEXT: ja LBB2_2
|
2011-12-03 17:32:07 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Darwin: pushl $0
|
|
|
|
; X32-Darwin-NEXT: pushl $40012
|
|
|
|
; X32-Darwin-NEXT: calll ___morestack
|
|
|
|
; X32-Darwin-NEXT: ret
|
2011-12-03 17:32:07 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X64-Darwin: leaq -40008(%rsp), %r11
|
|
|
|
; X64-Darwin-NEXT: cmpq %gs:816, %r11
|
|
|
|
; X64-Darwin-NEXT: ja LBB2_2
|
2011-12-03 17:32:07 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X64-Darwin: movabsq $40008, %r10
|
|
|
|
; X64-Darwin-NEXT: movabsq $0, %r11
|
|
|
|
; X64-Darwin-NEXT: callq ___morestack
|
|
|
|
; X64-Darwin-NEXT: ret
|
2011-12-03 17:32:07 +08:00
|
|
|
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-MinGW: leal -40000(%esp), %ecx
|
2012-01-13 04:22:08 +08:00
|
|
|
; X32-MinGW-NEXT: cmpl %fs:20, %ecx
|
|
|
|
; X32-MinGW-NEXT: ja LBB2_2
|
|
|
|
|
|
|
|
; X32-MinGW: pushl $0
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-MinGW-NEXT: pushl $40000
|
2012-01-13 04:22:08 +08:00
|
|
|
; X32-MinGW-NEXT: calll ___morestack
|
|
|
|
; X32-MinGW-NEXT: ret
|
|
|
|
|
2014-04-02 02:34:21 +08:00
|
|
|
; 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
|
|
|
|
|
2012-01-13 04:24:30 +08:00
|
|
|
; X64-FreeBSD: leaq -40008(%rsp), %r11
|
|
|
|
; X64-FreeBSD-NEXT: cmpq %fs:24, %r11
|
|
|
|
; X64-FreeBSD-NEXT: ja .LBB2_2
|
|
|
|
|
|
|
|
; X64-FreeBSD: movabsq $40008, %r10
|
|
|
|
; X64-FreeBSD-NEXT: movabsq $0, %r11
|
|
|
|
; X64-FreeBSD-NEXT: callq __morestack
|
|
|
|
; X64-FreeBSD-NEXT: ret
|
|
|
|
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-DFlyBSD: leal -40000(%esp), %ecx
|
2014-12-29 23:47:28 +08:00
|
|
|
; X32-DFlyBSD-NEXT: cmpl %fs:16, %ecx
|
|
|
|
; X32-DFlyBSD-NEXT: ja .LBB2_2
|
|
|
|
|
|
|
|
; X32-DFlyBSD: pushl $0
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-DFlyBSD-NEXT: pushl $40000
|
2014-12-29 23:47:28 +08:00
|
|
|
; X32-DFlyBSD-NEXT: calll __morestack
|
|
|
|
; X32-DFlyBSD-NEXT: ret
|
|
|
|
|
|
|
|
; X64-DFlyBSD: leaq -40008(%rsp), %r11
|
|
|
|
; X64-DFlyBSD-NEXT: cmpq %fs:32, %r11
|
|
|
|
; X64-DFlyBSD-NEXT: ja .LBB2_2
|
|
|
|
|
|
|
|
; X64-DFlyBSD: movabsq $40008, %r10
|
|
|
|
; X64-DFlyBSD-NEXT: movabsq $0, %r11
|
|
|
|
; X64-DFlyBSD-NEXT: callq __morestack
|
|
|
|
; X64-DFlyBSD-NEXT: ret
|
|
|
|
|
2011-12-03 17:32:07 +08:00
|
|
|
}
|
2012-01-12 02:41:19 +08:00
|
|
|
|
2014-04-11 06:58:43 +08:00
|
|
|
define fastcc void @test_fastcc() #0 {
|
2012-01-12 02:41:19 +08:00
|
|
|
%mem = alloca i32, i32 10
|
|
|
|
call void @dummy_use (i32* %mem, i32 10)
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-Linux-LABEL: test_fastcc:
|
2012-01-12 03:00:37 +08:00
|
|
|
|
|
|
|
; X32-Linux: cmpl %gs:48, %esp
|
|
|
|
; X32-Linux-NEXT: ja .LBB3_2
|
|
|
|
|
|
|
|
; X32-Linux: pushl $0
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-Linux-NEXT: pushl $44
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Linux-NEXT: calll __morestack
|
|
|
|
; X32-Linux-NEXT: ret
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X64-Linux-LABEL: test_fastcc:
|
2012-01-12 03:00:37 +08:00
|
|
|
|
|
|
|
; X64-Linux: cmpq %fs:112, %rsp
|
|
|
|
; X64-Linux-NEXT: ja .LBB3_2
|
2012-01-12 02:41:19 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X64-Linux: movabsq $40, %r10
|
|
|
|
; X64-Linux-NEXT: movabsq $0, %r11
|
|
|
|
; X64-Linux-NEXT: callq __morestack
|
|
|
|
; X64-Linux-NEXT: ret
|
2012-01-12 02:41:19 +08:00
|
|
|
|
2014-09-22 21:11:35 +08:00
|
|
|
; X32ABI-LABEL: test_fastcc:
|
|
|
|
|
|
|
|
; X32ABI: cmpl %fs:64, %esp
|
|
|
|
; X32ABI-NEXT: ja .LBB3_2
|
|
|
|
|
|
|
|
; X32ABI: movl $40, %r10d
|
|
|
|
; X32ABI-NEXT: movl $0, %r11d
|
|
|
|
; X32ABI-NEXT: callq __morestack
|
|
|
|
; X32ABI-NEXT: ret
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-Darwin-LABEL: test_fastcc:
|
2012-01-12 02:41:19 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Darwin: movl $432, %eax
|
|
|
|
; X32-Darwin-NEXT: cmpl %gs:(%eax), %esp
|
|
|
|
; X32-Darwin-NEXT: ja LBB3_2
|
2012-01-12 02:41:19 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Darwin: pushl $0
|
|
|
|
; X32-Darwin-NEXT: pushl $60
|
|
|
|
; X32-Darwin-NEXT: calll ___morestack
|
|
|
|
; X32-Darwin-NEXT: ret
|
2012-01-12 02:41:19 +08:00
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X64-Darwin-LABEL: test_fastcc:
|
2012-01-12 03:00:37 +08:00
|
|
|
|
|
|
|
; X64-Darwin: cmpq %gs:816, %rsp
|
|
|
|
; X64-Darwin-NEXT: ja LBB3_2
|
|
|
|
|
|
|
|
; X64-Darwin: movabsq $40, %r10
|
|
|
|
; X64-Darwin-NEXT: movabsq $0, %r11
|
|
|
|
; X64-Darwin-NEXT: callq ___morestack
|
|
|
|
; X64-Darwin-NEXT: ret
|
2012-01-12 02:41:19 +08:00
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-MinGW-LABEL: test_fastcc:
|
2012-01-13 04:22:08 +08:00
|
|
|
|
|
|
|
; X32-MinGW: cmpl %fs:20, %esp
|
|
|
|
; X32-MinGW-NEXT: ja LBB3_2
|
|
|
|
|
|
|
|
; X32-MinGW: pushl $0
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-MinGW-NEXT: pushl $40
|
2012-01-13 04:22:08 +08:00
|
|
|
; X32-MinGW-NEXT: calll ___morestack
|
|
|
|
; X32-MinGW-NEXT: ret
|
|
|
|
|
2014-04-02 02:34:21 +08:00
|
|
|
; 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
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X64-FreeBSD-LABEL: test_fastcc:
|
2012-01-13 04:24:30 +08:00
|
|
|
|
|
|
|
; X64-FreeBSD: cmpq %fs:24, %rsp
|
|
|
|
; X64-FreeBSD-NEXT: ja .LBB3_2
|
|
|
|
|
|
|
|
; X64-FreeBSD: movabsq $40, %r10
|
|
|
|
; X64-FreeBSD-NEXT: movabsq $0, %r11
|
|
|
|
; X64-FreeBSD-NEXT: callq __morestack
|
|
|
|
; X64-FreeBSD-NEXT: ret
|
|
|
|
|
2014-12-29 23:47:28 +08:00
|
|
|
; X32-DFlyBSD-LABEL: test_fastcc:
|
|
|
|
|
|
|
|
; X32-DFlyBSD: cmpl %fs:16, %esp
|
|
|
|
; X32-DFlyBSD-NEXT: ja .LBB3_2
|
|
|
|
|
|
|
|
; X32-DFlyBSD: pushl $0
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-DFlyBSD-NEXT: pushl $40
|
2014-12-29 23:47:28 +08:00
|
|
|
; X32-DFlyBSD-NEXT: calll __morestack
|
|
|
|
; X32-DFlyBSD-NEXT: ret
|
|
|
|
|
|
|
|
; X64-DFlyBSD-LABEL: test_fastcc:
|
|
|
|
|
|
|
|
; X64-DFlyBSD: cmpq %fs:32, %rsp
|
|
|
|
; X64-DFlyBSD-NEXT: ja .LBB3_2
|
|
|
|
|
|
|
|
; X64-DFlyBSD: movabsq $40, %r10
|
|
|
|
; X64-DFlyBSD-NEXT: movabsq $0, %r11
|
|
|
|
; X64-DFlyBSD-NEXT: callq __morestack
|
|
|
|
; X64-DFlyBSD-NEXT: ret
|
|
|
|
|
2012-01-12 02:41:19 +08:00
|
|
|
}
|
|
|
|
|
2014-04-11 06:58:43 +08:00
|
|
|
define fastcc void @test_fastcc_large() #0 {
|
2012-01-12 02:41:19 +08:00
|
|
|
%mem = alloca i32, i32 10000
|
|
|
|
call void @dummy_use (i32* %mem, i32 0)
|
|
|
|
ret void
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-Linux-LABEL: test_fastcc_large:
|
2012-01-12 03:00:37 +08:00
|
|
|
|
|
|
|
; X32-Linux: leal -40012(%esp), %eax
|
|
|
|
; X32-Linux-NEXT: cmpl %gs:48, %eax
|
|
|
|
; X32-Linux-NEXT: ja .LBB4_2
|
|
|
|
|
|
|
|
; X32-Linux: pushl $0
|
|
|
|
; X32-Linux-NEXT: pushl $40012
|
|
|
|
; X32-Linux-NEXT: calll __morestack
|
|
|
|
; X32-Linux-NEXT: ret
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X64-Linux-LABEL: test_fastcc_large:
|
2012-01-12 03:00:37 +08:00
|
|
|
|
|
|
|
; X64-Linux: leaq -40008(%rsp), %r11
|
|
|
|
; X64-Linux-NEXT: cmpq %fs:112, %r11
|
|
|
|
; X64-Linux-NEXT: ja .LBB4_2
|
|
|
|
|
|
|
|
; X64-Linux: movabsq $40008, %r10
|
|
|
|
; X64-Linux-NEXT: movabsq $0, %r11
|
|
|
|
; X64-Linux-NEXT: callq __morestack
|
|
|
|
; X64-Linux-NEXT: ret
|
|
|
|
|
2014-09-22 21:11:35 +08:00
|
|
|
; X32ABI-LABEL: test_fastcc_large:
|
|
|
|
|
|
|
|
; X32ABI: leal -40008(%rsp), %r11d
|
|
|
|
; X32ABI-NEXT: cmpl %fs:64, %r11d
|
|
|
|
; X32ABI-NEXT: ja .LBB4_2
|
|
|
|
|
|
|
|
; X32ABI: movl $40008, %r10d
|
|
|
|
; X32ABI-NEXT: movl $0, %r11d
|
|
|
|
; X32ABI-NEXT: callq __morestack
|
|
|
|
; X32ABI-NEXT: ret
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-Darwin-LABEL: test_fastcc_large:
|
2012-01-12 03:00:37 +08:00
|
|
|
|
|
|
|
; X32-Darwin: leal -40012(%esp), %eax
|
|
|
|
; X32-Darwin-NEXT: movl $432, %ecx
|
|
|
|
; X32-Darwin-NEXT: cmpl %gs:(%ecx), %eax
|
|
|
|
; X32-Darwin-NEXT: ja LBB4_2
|
|
|
|
|
|
|
|
; X32-Darwin: pushl $0
|
|
|
|
; X32-Darwin-NEXT: pushl $40012
|
|
|
|
; X32-Darwin-NEXT: calll ___morestack
|
|
|
|
; X32-Darwin-NEXT: ret
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X64-Darwin-LABEL: test_fastcc_large:
|
2012-01-12 03:00:37 +08:00
|
|
|
|
|
|
|
; X64-Darwin: leaq -40008(%rsp), %r11
|
|
|
|
; X64-Darwin-NEXT: cmpq %gs:816, %r11
|
|
|
|
; X64-Darwin-NEXT: ja LBB4_2
|
|
|
|
|
|
|
|
; X64-Darwin: movabsq $40008, %r10
|
|
|
|
; X64-Darwin-NEXT: movabsq $0, %r11
|
|
|
|
; X64-Darwin-NEXT: callq ___morestack
|
|
|
|
; X64-Darwin-NEXT: ret
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-MinGW-LABEL: test_fastcc_large:
|
2012-01-13 04:22:08 +08:00
|
|
|
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-MinGW: leal -40000(%esp), %eax
|
2012-01-13 04:22:08 +08:00
|
|
|
; X32-MinGW-NEXT: cmpl %fs:20, %eax
|
|
|
|
; X32-MinGW-NEXT: ja LBB4_2
|
|
|
|
|
|
|
|
; X32-MinGW: pushl $0
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-MinGW-NEXT: pushl $40000
|
2012-01-13 04:22:08 +08:00
|
|
|
; X32-MinGW-NEXT: calll ___morestack
|
|
|
|
; X32-MinGW-NEXT: ret
|
|
|
|
|
2014-04-02 02:34:21 +08:00
|
|
|
; 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
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X64-FreeBSD-LABEL: test_fastcc_large:
|
2012-01-13 04:24:30 +08:00
|
|
|
|
|
|
|
; X64-FreeBSD: leaq -40008(%rsp), %r11
|
|
|
|
; X64-FreeBSD-NEXT: cmpq %fs:24, %r11
|
|
|
|
; X64-FreeBSD-NEXT: ja .LBB4_2
|
|
|
|
|
|
|
|
; X64-FreeBSD: movabsq $40008, %r10
|
|
|
|
; X64-FreeBSD-NEXT: movabsq $0, %r11
|
|
|
|
; X64-FreeBSD-NEXT: callq __morestack
|
|
|
|
; X64-FreeBSD-NEXT: ret
|
|
|
|
|
2014-12-29 23:47:28 +08:00
|
|
|
; X32-DFlyBSD-LABEL: test_fastcc_large:
|
|
|
|
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-DFlyBSD: leal -40000(%esp), %eax
|
2014-12-29 23:47:28 +08:00
|
|
|
; X32-DFlyBSD-NEXT: cmpl %fs:16, %eax
|
|
|
|
; X32-DFlyBSD-NEXT: ja .LBB4_2
|
|
|
|
|
|
|
|
; X32-DFlyBSD: pushl $0
|
2016-03-31 07:38:01 +08:00
|
|
|
; X32-DFlyBSD-NEXT: pushl $40000
|
2014-12-29 23:47:28 +08:00
|
|
|
; X32-DFlyBSD-NEXT: calll __morestack
|
|
|
|
; X32-DFlyBSD-NEXT: ret
|
|
|
|
|
|
|
|
; X64-DFlyBSD-LABEL: test_fastcc_large:
|
|
|
|
|
|
|
|
; X64-DFlyBSD: leaq -40008(%rsp), %r11
|
|
|
|
; X64-DFlyBSD-NEXT: cmpq %fs:32, %r11
|
|
|
|
; X64-DFlyBSD-NEXT: ja .LBB4_2
|
|
|
|
|
|
|
|
; X64-DFlyBSD: movabsq $40008, %r10
|
|
|
|
; X64-DFlyBSD-NEXT: movabsq $0, %r11
|
|
|
|
; X64-DFlyBSD-NEXT: callq __morestack
|
|
|
|
; X64-DFlyBSD-NEXT: ret
|
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
}
|
|
|
|
|
2014-04-11 06:58:43 +08:00
|
|
|
define fastcc void @test_fastcc_large_with_ecx_arg(i32 %a) #0 {
|
2012-01-12 03:00:37 +08:00
|
|
|
%mem = alloca i32, i32 10000
|
|
|
|
call void @dummy_use (i32* %mem, i32 %a)
|
|
|
|
ret void
|
2012-01-12 02:41:19 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; This is testing that the Mac implementation preserves ecx
|
2012-01-12 02:41:19 +08:00
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-Darwin-LABEL: test_fastcc_large_with_ecx_arg:
|
2012-01-12 02:41:19 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Darwin: leal -40012(%esp), %eax
|
|
|
|
; X32-Darwin-NEXT: pushl %ecx
|
|
|
|
; X32-Darwin-NEXT: movl $432, %ecx
|
|
|
|
; X32-Darwin-NEXT: cmpl %gs:(%ecx), %eax
|
|
|
|
; X32-Darwin-NEXT: popl %ecx
|
|
|
|
; X32-Darwin-NEXT: ja LBB5_2
|
2012-01-12 02:41:19 +08:00
|
|
|
|
2012-01-12 03:00:37 +08:00
|
|
|
; X32-Darwin: pushl $0
|
|
|
|
; X32-Darwin-NEXT: pushl $40012
|
|
|
|
; X32-Darwin-NEXT: calll ___morestack
|
|
|
|
; X32-Darwin-NEXT: ret
|
2012-01-12 02:41:19 +08:00
|
|
|
|
|
|
|
}
|
2014-04-11 06:58:43 +08:00
|
|
|
|
2014-05-22 21:03:43 +08:00
|
|
|
define void @test_nostack() #0 {
|
|
|
|
ret void
|
|
|
|
|
|
|
|
; X32-Linux-LABEL: test_nostack:
|
|
|
|
; X32-Linux-NOT: calll __morestack
|
|
|
|
|
|
|
|
; X64-Linux-LABEL: test_nostack:
|
|
|
|
; X32-Linux-NOT: callq __morestack
|
|
|
|
|
2014-09-22 21:11:35 +08:00
|
|
|
; X32ABI-LABEL: test_nostack:
|
|
|
|
; X32ABI-NOT: callq __morestack
|
|
|
|
|
2014-05-22 21:03:43 +08:00
|
|
|
; X32-Darwin-LABEL: test_nostack:
|
|
|
|
; X32-Darwin-NOT: calll __morestack
|
|
|
|
|
|
|
|
; X64-Darwin-LABEL: test_nostack:
|
|
|
|
; X64-Darwin-NOT: callq __morestack
|
|
|
|
|
|
|
|
; X32-MinGW-LABEL: test_nostack:
|
|
|
|
; X32-MinGW-NOT: calll __morestack
|
|
|
|
|
|
|
|
; X64-MinGW-LABEL: test_nostack:
|
|
|
|
; X64-MinGW-NOT: callq __morestack
|
|
|
|
|
|
|
|
; X64-FreeBSD-LABEL: test_nostack:
|
|
|
|
; X64-FreeBSD-NOT: callq __morestack
|
2014-12-29 23:47:28 +08:00
|
|
|
|
|
|
|
; X32-DFlyBSD-LABEL: test_nostack:
|
|
|
|
; X32-DFlyBSD-NOT: calll __morestack
|
|
|
|
|
|
|
|
; X64-DFlyBSD-LABEL: test_nostack:
|
|
|
|
; X64-DFlyBSD-NOT: callq __morestack
|
2014-05-22 21:03:43 +08:00
|
|
|
}
|
|
|
|
|
2017-09-28 03:34:00 +08:00
|
|
|
define void @test_nosplitstck() {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-04-11 06:58:43 +08:00
|
|
|
attributes #0 = { "split-stack" }
|
2014-12-31 04:05:19 +08:00
|
|
|
|
|
|
|
; X64-Linux-Large: .rodata
|
|
|
|
; X64-Linux-Large-NEXT: __morestack_addr:
|
|
|
|
; X64-Linux-Large-NEXT: .quad __morestack
|
2017-09-28 03:34:00 +08:00
|
|
|
|
|
|
|
; X32-Linux: .section ".note.GNU-split-stack","",@progbits
|
|
|
|
; X32-Linux: .section ".note.GNU-no-split-stack","",@progbits
|
|
|
|
|
|
|
|
; X64-Linux: .section ".note.GNU-split-stack","",@progbits
|
|
|
|
; X64-Linux: .section ".note.GNU-no-split-stack","",@progbits
|
|
|
|
|
|
|
|
; X64-FreeBSD: .section ".note.GNU-split-stack","",@progbits
|
|
|
|
; X64-FreeBSD: .section ".note.GNU-no-split-stack","",@progbits
|
|
|
|
|
|
|
|
; X32-DFlyBSD: .section ".note.GNU-split-stack","",@progbits
|
|
|
|
; X32-DFlyBSD: .section ".note.GNU-no-split-stack","",@progbits
|
|
|
|
|
|
|
|
; X64-DFlyBSD: .section ".note.GNU-split-stack","",@progbits
|
|
|
|
; X64-DFlyBSD: .section ".note.GNU-no-split-stack","",@progbits
|