1 ; RUN: llc --mtriple=loongarch64 %s -o - | FileCheck %s
2 ; RUN: llc --mtriple=loongarch64 -filetype=obj %s -o %t
3 ; RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=RELOC
5 define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" {
7 ; CHECK-LABEL: .Lfunc_begin0:
9 ; CHECK-LABEL: .Lxray_sled_begin0:
10 ; CHECK-NEXT: b .Lxray_sled_end0
12 ; CHECK-LABEL: .Lxray_sled_end0:
14 ; CHECK-LABEL: .Lxray_sled_begin1:
15 ; CHECK-NEXT: b .Lxray_sled_end1
17 ; CHECK-NEXT: .Lxray_sled_end1:
19 ; CHECK-NEXT: .Lfunc_end0:
22 ; CHECK-LABEL: .section xray_instr_map
23 ; CHECK-NEXT: .Lxray_sleds_start0:
24 ; CHECK-NEXT: [[TMP:.Ltmp[0-9]+]]:
25 ; CHECK-NEXT: .dword .Lxray_sled_begin0-[[TMP]]
26 ; CHECK-NEXT: .dword .Lfunc_begin0-([[TMP]]+8)
27 ; CHECK-NEXT: .byte 0x00
28 ; CHECK-NEXT: .byte 0x01
29 ; CHECK-NEXT: .byte 0x02
30 ; CHECK-NEXT: .space 13
31 ; CHECK-NEXT: [[TMP:.Ltmp[0-9]+]]:
32 ; CHECK-NEXT: .dword .Lxray_sled_begin1-[[TMP]]
33 ; CHECK-NEXT: .dword .Lfunc_begin0-([[TMP]]+8)
34 ; CHECK-NEXT: .byte 0x01
35 ; CHECK-NEXT: .byte 0x01
36 ; CHECK-NEXT: .byte 0x02
37 ; CHECK-NEXT: .space 13
38 ; CHECK-NEXT: .Lxray_sleds_end0:
40 ; CHECK-LABEL: .section xray_fn_idx
41 ; CHECK: [[IDX:.Lxray_fn_idx[0-9]+]]:
42 ; CHECK: .dword .Lxray_sleds_start0-[[IDX]]
43 ; CHECK-NEXT: .dword 2
45 ; RELOC: Section ([[#]]) .relaxray_instr_map {
46 ; RELOC-NEXT: 0x0 R_LARCH_64_PCREL .text 0x0
47 ; RELOC-NEXT: 0x8 R_LARCH_64_PCREL .text 0x0
48 ; RELOC-NEXT: 0x20 R_LARCH_64_PCREL .text 0x34
49 ; RELOC-NEXT: 0x28 R_LARCH_64_PCREL .text 0x0
51 ; RELOC-NEXT: Section ([[#]]) .relaxray_fn_idx {
52 ; RELOC-NEXT: 0x0 R_LARCH_64_PCREL xray_instr_map 0x0
54 ; RELOC-NEXT: Section ([[#]]) .rela.eh_frame {
55 ; RELOC-NEXT: 0x1C R_LARCH_32_PCREL .text 0x0