X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FCodeGen%2FX86%2Fsegmented-stacks-dynamic.ll;h=e34ba5412f07a8bb63fd8ce5a84230de59de3bb2;hb=9cf6c2466002e9cb562fd9ccbca81990d9e1e40d;hp=5ce08aa51c76b4eb8c5257538f073f2d8fcd0cf8;hpb=922d314e8f9f0d8e447c055485a2969ee9cf2dd2;p=oota-llvm.git diff --git a/test/CodeGen/X86/segmented-stacks-dynamic.ll b/test/CodeGen/X86/segmented-stacks-dynamic.ll index 5ce08aa51c7..e34ba5412f0 100644 --- a/test/CodeGen/X86/segmented-stacks-dynamic.ll +++ b/test/CodeGen/X86/segmented-stacks-dynamic.ll @@ -1,12 +1,14 @@ -; RUN: llc < %s -mcpu=generic -mtriple=i686-linux -segmented-stacks -verify-machineinstrs | FileCheck %s -check-prefix=X32 -; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux -segmented-stacks -verify-machineinstrs | FileCheck %s -check-prefix=X64 -; RUN: llc < %s -mcpu=generic -mtriple=i686-linux -segmented-stacks -filetype=obj -; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux -segmented-stacks -filetype=obj +; RUN: llc < %s -mcpu=generic -mtriple=i686-linux -verify-machineinstrs | FileCheck %s -check-prefix=X32 +; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux -verify-machineinstrs | FileCheck %s -check-prefix=X64 +; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnux32 -verify-machineinstrs | FileCheck %s -check-prefix=X32ABI +; RUN: llc < %s -mcpu=generic -mtriple=i686-linux -filetype=obj +; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux -filetype=obj +; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnux32 -filetype=obj ; Just to prevent the alloca from being optimized away declare void @dummy_use(i32*, i32) -define i32 @test_basic(i32 %l) { +define i32 @test_basic(i32 %l) #0 { %mem = alloca i32, i32 %l call void @dummy_use (i32* %mem, i32 %l) %terminate = icmp eq i32 %l, 0 @@ -20,7 +22,7 @@ false: %retvalue = call i32 @test_basic(i32 %newlen) ret i32 %retvalue -; X32: test_basic: +; X32-LABEL: test_basic: ; X32: cmpl %gs:48, %esp ; X32-NEXT: ja .LBB0_2 @@ -31,7 +33,7 @@ false: ; X32-NEXT: ret ; X32: movl %esp, %eax -; X32-NEXT: subl %ecx, %eax +; X32: subl %ecx, %eax ; X32-NEXT: cmpl %eax, %gs:48 ; X32: movl %eax, %esp @@ -41,7 +43,7 @@ false: ; X32-NEXT: calll __morestack_allocate_stack_space ; X32-NEXT: addl $16, %esp -; X64: test_basic: +; X64-LABEL: test_basic: ; X64: cmpq %fs:112, %rsp ; X64-NEXT: ja .LBB0_2 @@ -51,14 +53,36 @@ false: ; X64-NEXT: callq __morestack ; X64-NEXT: ret -; X64: movq %rsp, %rdi -; X64-NEXT: subq %rax, %rdi -; X64-NEXT: cmpq %rdi, %fs:112 +; X64: movq %rsp, %[[RDI:rdi|rax]] +; X64: subq %{{.*}}, %[[RDI]] +; X64-NEXT: cmpq %[[RDI]], %fs:112 -; X64: movq %rdi, %rsp +; X64: movq %[[RDI]], %rsp -; X64: movq %rax, %rdi +; X64: movq %{{.*}}, %rdi ; X64-NEXT: callq __morestack_allocate_stack_space -; X64-NEXT: movq %rax, %rdi +; X64: movq %rax, %rdi + +; X32ABI-LABEL: test_basic: + +; X32ABI: cmpl %fs:64, %esp +; X32ABI-NEXT: ja .LBB0_2 + +; X32ABI: movl $24, %r10d +; X32ABI-NEXT: movl $0, %r11d +; X32ABI-NEXT: callq __morestack +; X32ABI-NEXT: ret + +; X32ABI: movl %esp, %[[EDI:edi|eax]] +; X32ABI: subl %{{.*}}, %[[EDI]] +; X32ABI-NEXT: cmpl %[[EDI]], %fs:64 + +; X32ABI: movl %[[EDI]], %esp + +; X32ABI: movl %{{.*}}, %edi +; X32ABI-NEXT: callq __morestack_allocate_stack_space +; X32ABI: movl %eax, %edi } + +attributes #0 = { "split-stack" }