1 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
3 ; RUN: -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s
4 ; RUN: llc -mtriple=x86_64-darwin-unknown < %s | FileCheck %s
6 define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" "xray-skip-exit" {
7 ; CHECK: .p2align 1, 0x90
8 ; CHECK-LABEL: Lxray_sled_0:
9 ; CHECK: .ascii "\353\t"
10 ; CHECK-NEXT: nopw 512(%rax,%rax)
12 ; CHECK-NOT: Lxray_sled_1:
16 ; CHECK-LINUX-LABEL: .section xray_instr_map,"ao",@progbits,foo{{$}}
17 ; CHECK-LINUX-LABEL: .Lxray_sleds_start0:
18 ; CHECK-LINUX: .quad .Lxray_sled_0
19 ; CHECK-LINUX-LABEL: .Lxray_sleds_end0:
20 ; CHECK-LINUX-LABEL: .section xray_fn_idx,"awo",@progbits,foo{{$}}
21 ; CHECK-LINUX: [[IDX:.lxray_fn_idx[0-9]+]]:
22 ; CHECK-LINUX: .quad .Lxray_sleds_start0-[[IDX]]
23 ; CHECK-LINUX-NEXT: .quad .Lxray_sleds_end0
25 ; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map,regular,live_support{{$}}
26 ; CHECK-MACOS-LABEL: lxray_sleds_start0:
27 ; CHECK-MACOS: .quad Lxray_sled_0
28 ; CHECK-MACOS-LABEL: Lxray_sleds_end0:
29 ; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx,regular,live_support{{$}}
30 ; CHECK-MACOS: [[IDX:lxray_fn_idx[0-9]+]]:
31 ; CHECK-MACOS: .quad lxray_sleds_start0-[[IDX]]
32 ; CHECK-MACOS-NEXT: .quad Lxray_sleds_end0
35 ; We test multiple returns in a single function to make sure we're skipping all
36 ; of them with XRay instrumentation.
37 define i32 @bar(i32 %i) nounwind noinline uwtable "function-instrument"="xray-always" "xray-skip-exit" {
38 ; CHECK: .p2align 1, 0x90
39 ; CHECK-LABEL: Lxray_sled_1:
40 ; CHECK: .ascii "\353\t"
41 ; CHECK-NEXT: nopw 512(%rax,%rax)
43 %cond = icmp eq i32 %i, 0
44 br i1 %cond, label %IsEqual, label %NotEqual
47 ; CHECK-NOT: Lxray_sled_{{.*}}:
51 ; CHECK-NOT: Lxray_sled_{{.*}}:
55 ; CHECK-LINUX-LABEL: .section xray_instr_map,"ao",@progbits,bar{{$}}
56 ; CHECK-LINUX-LABEL: .Lxray_sleds_start1:
57 ; CHECK-LINUX: .quad .Lxray_sled_1
58 ; CHECK-LINUX-LABEL: .Lxray_sleds_end1:
59 ; CHECK-LINUX-LABEL: .section xray_fn_idx,"awo",@progbits,bar{[$}}
60 ; CHECK-LINUX: .Lxray_fn_idx0:
61 ; CHECK-LINUX-NEXT: .quad .Lxray_sleds_start1-.Lxray_fn_idx0
62 ; CHECK-LINUX-NEXT: .quad 2
64 ; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map,regular,live_support{{$}}
65 ; CHECK-MACOS-LABEL: lxray_sleds_start1:
66 ; CHECK-MACOS: .quad Lxray_sled_1
67 ; CHECK-MACOS-LABEL: Lxray_sleds_end1:
68 ; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx,regular,live_support{{$}}
69 ; CHECK-MACOS: Lxray_fn_idx0:
70 ; CHECK-MACOS-NEXT: .quad Lxray_sleds_start1-Lxray_fn_idx0
71 ; CHECK-MACOS-NEXT: .quad 2