1 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX
2 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX
3 ; RUN: llc -mtriple=x86_64-darwin-unknown < %s | FileCheck %s --check-prefixes=CHECK,CHECK-MACOS
5 define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" "xray-skip-entry" {
6 ; CHECK-NOT: Lxray_sled_0:
8 ; CHECK: .p2align 1, 0x90
9 ; CHECK-LABEL: Lxray_sled_0:
11 ; CHECK-NEXT: nopw %cs:512(%rax,%rax)
14 ; CHECK-LINUX-LABEL: .section xray_instr_map,"ao",@progbits,foo{{$}}
15 ; CHECK-LINUX-LABEL: .Lxray_sleds_start0:
16 ; CHECK-LINUX: .quad .Lxray_sled_0
17 ; CHECK-LINUX-LABEL: .Lxray_sleds_end0:
18 ; CHECK-LINUX-LABEL: .section xray_fn_idx,"ao",@progbits,foo{{$}}
19 ; CHECK-LINUX: [[IDX:\.Lxray_fn_idx[0-9]+]]:
20 ; CHECK-LINUX-NEXT: .quad .Lxray_sleds_start0-[[IDX]]
21 ; CHECK-LINUX-NEXT: .quad 1
23 ; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map,regular,live_support{{$}}
24 ; CHECK-MACOS-LABEL: lxray_sleds_start0:
25 ; CHECK-MACOS: .quad Lxray_sled_0
26 ; CHECK-MACOS-LABEL: Lxray_sleds_end0:
27 ; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx,regular,live_support{{$}}
28 ; CHECK-MACOS: [[IDX:lxray_fn_idx[0-9]+]]:
29 ; CHECK-MACOS-NEXT: .quad lxray_sleds_start0-[[IDX]]
30 ; CHECK-MACOS-NEXT: .quad 1
33 ; We test multiple returns in a single function to make sure we're getting all
34 ; of them with XRay instrumentation.
35 define i32 @bar(i32 %i) nounwind noinline uwtable "function-instrument"="xray-always" "xray-skip-entry" {
36 ; CHECK-NOT: Lxray_sled_1:
38 %cond = icmp eq i32 %i, 0
39 br i1 %cond, label %IsEqual, label %NotEqual
42 ; CHECK: .p2align 1, 0x90
43 ; CHECK-LABEL: Lxray_sled_1:
45 ; CHECK-NEXT: nopw %cs:512(%rax,%rax)
48 ; CHECK: .p2align 1, 0x90
49 ; CHECK-LABEL: Lxray_sled_2:
51 ; CHECK-NEXT: nopw %cs:512(%rax,%rax)
54 ; CHECK-LINUX-LABEL: .section xray_instr_map,"ao",@progbits,bar{{$}}
55 ; CHECK-LINUX-LABEL: .Lxray_sleds_start1:
56 ; CHECK-LINUX: .quad .Lxray_sled_1
57 ; CHECK-LINUX: .quad .Lxray_sled_2
58 ; CHECK-LINUX-LABEL: .Lxray_sleds_end1:
59 ; CHECK-LINUX-LABEL: .section xray_fn_idx,"ao",@progbits,bar{{$}}
60 ; CHECK-LINUX: [[IDX:\.Lxray_fn_idx[0-9]+]]:
61 ; CHECK-LINUX-NEXT: .quad .Lxray_sleds_start1-[[IDX]]
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: .quad Lxray_sled_2
68 ; CHECK-MACOS-LABEL: Lxray_sleds_end1:
69 ; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx,regular,live_support{{$}}
70 ; CHECK-MACOS: [[IDX:lxray_fn_idx[0-9]+]]:
71 ; CHECK-MACOS-NEXT: .quad lxray_sleds_start1-[[IDX]]
72 ; CHECK-MACOS-NEXT: .quad 2