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 ; NOTE: Currently NOT testing alloca lowering in the StackMap format. Its
26 %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)
27 %call1 = call zeroext i1 @llvm.experimental.gc.result.int.i1(i32 %safepoint_token)
28 %a = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %safepoint_token, i32 4, i32 4)
29 %b = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %safepoint_token, i32 5, i32 5)
34 declare i32 @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()*, i32, i32, ...)
35 declare i1 @llvm.experimental.gc.result.int.i1(i32)
36 declare i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32, i32, i32) #3
39 ; CHECK-LABEL: .section .llvm_stackmaps
40 ; CHECK-NEXT: __LLVM_StackMaps:
44 ; CHECK-NEXT: .short 0
52 ; Functions and stack size
53 ; CHECK-NEXT: .quad test
54 ; CHECK-NEXT: .quad 24
58 ; CHECK: .quad 2882400000
62 ; CHECK: .long .Ltmp1-test
75 ; Direct Spill Slot [RSP+0]
95 ; Direct Spill Slot [RSP+0]
100 ; Direct Spill Slot [RSP+0]
106 ; No Padding or LiveOuts