• 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-entry" {
7; CHECK-NOT: Lxray_sled_0:
8  ret i32 0
9; CHECK:       .p2align 1, 0x90
10; CHECK-LABEL: Lxray_sled_0:
11; CHECK:       retq
12; CHECK-NEXT:  nopw %cs:512(%rax,%rax)
13}
14; CHECK-LABEL: xray_instr_map
15; CHECK-LABEL: Lxray_sleds_start0:
16; CHECK:       .quad {{.*}}xray_sled_0
17; CHECK-LABEL: Lxray_sleds_end0:
18; CHECK-LABEL: xray_fn_idx
19; CHECK:       .quad {{.*}}xray_sleds_start0
20; CHECK-NEXT:  .quad {{.*}}xray_sleds_end0
21
22
23; We test multiple returns in a single function to make sure we're getting all
24; of them with XRay instrumentation.
25define i32 @bar(i32 %i) nounwind noinline uwtable "function-instrument"="xray-always" "xray-skip-entry" {
26; CHECK-NOT: Lxray_sled_1:
27Test:
28  %cond = icmp eq i32 %i, 0
29  br i1 %cond, label %IsEqual, label %NotEqual
30IsEqual:
31  ret i32 0
32; CHECK:       .p2align 1, 0x90
33; CHECK-LABEL: Lxray_sled_1:
34; CHECK:       retq
35; CHECK-NEXT:  nopw %cs:512(%rax,%rax)
36NotEqual:
37  ret i32 1
38; CHECK:       .p2align 1, 0x90
39; CHECK-LABEL: Lxray_sled_2:
40; CHECK:       retq
41; CHECK-NEXT:  nopw %cs:512(%rax,%rax)
42}
43; CHECK-LABEL: xray_instr_map
44; CHECK-LABEL: Lxray_sleds_start1:
45; CHECK:       .quad {{.*}}xray_sled_1
46; CHECK:       .quad {{.*}}xray_sled_2
47; CHECK-LABEL: Lxray_sleds_end1:
48; CHECK-LABEL: xray_fn_idx
49; CHECK:       .quad {{.*}}xray_sleds_start1
50; CHECK-NEXT:  .quad {{.*}}xray_sleds_end1
51