• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -verify-machineinstrs -filetype=asm -o - -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
2; RUN: llc -verify-machineinstrs -filetype=asm -o - \
3; RUN:     -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s
4; RUN: llc -verify-machineinstrs -filetype=asm -o - -mtriple=x86_64-darwin-unknown    < %s | FileCheck %s
5
6define 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)
11  ret i32 0
12; CHECK-NOT: Lxray_sled_1:
13; CHECK:       retq
14}
15; CHECK-LABEL: xray_instr_map
16; CHECK-LABEL: Lxray_sleds_start0:
17; CHECK:       .quad {{.*}}xray_sled_0
18; CHECK-LABEL: Lxray_sleds_end0:
19; CHECK-LABEL: xray_fn_idx
20; CHECK:       .quad {{.*}}xray_sleds_start0
21; CHECK-NEXT:  .quad {{.*}}xray_sleds_end0
22
23
24; We test multiple returns in a single function to make sure we're skipping all
25; of them with XRay instrumentation.
26define i32 @bar(i32 %i) nounwind noinline uwtable "function-instrument"="xray-always" "xray-skip-exit" {
27; CHECK:       .p2align 1, 0x90
28; CHECK-LABEL: Lxray_sled_1:
29; CHECK:       .ascii "\353\t"
30; CHECK-NEXT:  nopw 512(%rax,%rax)
31Test:
32  %cond = icmp eq i32 %i, 0
33  br i1 %cond, label %IsEqual, label %NotEqual
34IsEqual:
35  ret i32 0
36; CHECK-NOT: Lxray_sled_{{.*}}:
37; CHECK:       retq
38NotEqual:
39  ret i32 1
40; CHECK-NOT: Lxray_sled_{{.*}}:
41; CHECK:       retq
42}
43; CHECK-LABEL: xray_instr_map
44; CHECK-LABEL: Lxray_sleds_start1:
45; CHECK:       .quad {{.*}}xray_sled_1
46; CHECK-LABEL: Lxray_sleds_end1:
47; CHECK-LABEL: xray_fn_idx
48; CHECK:       .quad {{.*}}xray_sleds_start1
49; CHECK-NEXT:  .quad {{.*}}xray_sleds_end1
50