1 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
3 ; Used to crash with assertions when emitting object files.
4 ; RUN: llc -filetype=obj %s -o /dev/null
6 ; Check stack map section is emitted before debug info.
7 ; CHECK: .section __LLVM_STACKMAPS
8 ; CHECK: .section __DWARF
10 target triple = "x86_64-apple-macosx12.0"
14 define ptr addrspace(1) @test1(ptr addrspace(1) %arg) gc "statepoint-example" {
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
21 declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
22 declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32)
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}