xref: /llvm-project/llvm/test/CodeGen/X86/stackmap-macho.ll (revision f049b2c3fcbae739ac965f97fd6855ca1aab77b8)
1; RUN: llc  -verify-machineinstrs < %s | FileCheck %s
2
3; Used to crash with assertions when emitting object files.
4; RUN: llc -filetype=obj %s -o /dev/null
5
6; Check stack map section is emitted before debug info.
7; CHECK: .section __LLVM_STACKMAPS
8; CHECK: .section __DWARF
9
10target triple = "x86_64-apple-macosx12.0"
11
12declare void @func()
13
14define ptr addrspace(1) @test1(ptr addrspace(1) %arg) gc "statepoint-example" {
15entry:
16  %safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @func, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg)]
17  %reloc1 = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token,  i32 0, i32 0)
18  ret ptr addrspace(1) %reloc1
19}
20
21declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
22declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32)
23
24!llvm.dbg.cu = !{!0}
25!llvm.module.flags = !{!2}
26!0 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "clang", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !{}, retainedTypes: !{})
27!1 = !DIFile(filename: "t.c", directory: "")
28!2 = !{i32 2, !"Debug Info Version", i32 3}
29