1 ; RUN: llc < %s | FileCheck %s
2 ; This test is a sanity check to ensure statepoints are generating StackMap
3 ; sections correctly. This is not intended to be a rigorous test of the
4 ; StackMap format (see the stackmap tests for that).
6 target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-pc-linux-gnu"
9 declare zeroext i1 @return_i1()
11 define i1 @test(i32 addrspace(1)* %ptr) {
13 ; Do we see one spill for the local value and the store to the
15 ; CHECK: subq $24, %rsp
16 ; CHECK: movq $0, 8(%rsp)
17 ; CHECK: movq %rdi, (%rsp)
18 ; CHECK: callq return_i1
19 ; CHECK: addq $24, %rsp
22 %metadata1 = alloca i32 addrspace(1)*, i32 2, align 8
23 store i32 addrspace(1)* null, i32 addrspace(1)** %metadata1
24 %safepoint_token = tail call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 2, i32 addrspace(1)* %ptr, i32 addrspace(1)* null, i32 addrspace(1)* %ptr, i32 addrspace(1)* null)
25 %call1 = call zeroext i1 @llvm.experimental.gc.result.int.i1(i32 %safepoint_token)
26 %a = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %safepoint_token, i32 6, i32 6)
27 %b = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %safepoint_token, i32 7, i32 7)
32 declare i32 @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()*, i32, i32, ...)
33 declare i1 @llvm.experimental.gc.result.int.i1(i32)
34 declare i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32, i32, i32) #3
37 ; CHECK-LABEL: .section .llvm_stackmaps
38 ; CHECK-NEXT: __LLVM_StackMaps:
42 ; CHECK-NEXT: .short 0
50 ; Functions and stack size
51 ; CHECK-NEXT: .quad test
52 ; CHECK-NEXT: .quad 24
56 ; CHECK: .quad 2882400000
60 ; CHECK: .long .Ltmp1-test
73 ; Direct Spill Slot [RSP+0]
93 ; Direct Spill Slot [RSP+0]
98 ; Direct Spill Slot [RSP+0]
104 ; No Padding or LiveOuts