xref: /llvm-project/llvm/test/CodeGen/X86/sjlj-baseptr.ll (revision ba8a520512b7c36a9958ddbf9be96a33ed0279b8)
1; RUN: llc < %s -mtriple=i386-pc-linux -mcpu=corei7 -relocation-model=static | FileCheck --check-prefix=X86 %s
2; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=corei7 -relocation-model=static | FileCheck --check-prefix=X64 %s
3
4target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5
6%Foo = type { [125 x i8] }
7
8declare i32 @llvm.eh.sjlj.setjmp(ptr) nounwind
9
10declare void @whatever(i64, ptr, ptr, ptr, ptr, i32)  #0
11
12attributes #0 = { nounwind uwtable "frame-pointer"="all" }
13
14define i32 @test1(i64 %n, ptr byval(%Foo) nocapture readnone align 8 %f) #0 {
15entry:
16  %buf = alloca [5 x ptr], align 16
17  %p = alloca ptr, align 8
18  %q = alloca i8, align 64
19  %s = alloca i8, i64 %n, align 1
20  store ptr %s, ptr %p, align 8
21  %t = call i32 @llvm.eh.sjlj.setjmp(ptr %s)
22  call void @whatever(i64 %n, ptr %f, ptr %p, ptr %q, ptr %s, i32 %t) #1
23  ret i32 0
24; X86: pushl   %esi
25; X86-NEXT: pushl   %esi
26; X86: movl    %esp, %esi
27; X86: movl    %esp, -16(%ebp)
28; X86: {{.LBB.*:}}
29; X86: movl    -16(%ebp), %esi
30; X86: {{.LBB.*:}}
31; X86: popl    %esi
32; X86-NEXT: popl    %esi
33; X64: pushq   %rbx
34; X64-NEXT: pushq   %rbx
35; X64: movq    %rsp, %rbx
36; X64: movq    %rsp, -48(%rbp)
37; X64: {{.LBB.*:}}
38; X64: movq    -48(%rbp), %rbx
39; X64: {{.LBB.*:}}
40; X64: popq    %rbx
41; X64-NEXT: popq    %rbx
42}
43
44
45