• 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 -check-prefix=PIC
4
5define i32 @fn() nounwind noinline uwtable "function-instrument"="xray-always" {
6    %eventptr = alloca i8
7    %eventsize = alloca i32
8    store i32 3, i32* %eventsize
9    %val = load i32, i32* %eventsize
10    call void @llvm.xray.customevent(i8* %eventptr, i32 %val)
11    ; CHECK-LABEL: Lxray_event_sled_0:
12    ; CHECK:       .byte 0xeb, 0x0f
13    ; CHECK-NEXT:  pushq %rdi
14    ; CHECK-NEXT:  pushq %rsi
15    ; CHECK-NEXT:  movq {{.*}}, %rdi
16    ; CHECK-NEXT:  movq {{.*}}, %rsi
17    ; CHECK-NEXT:  callq __xray_CustomEvent
18    ; CHECK-NEXT:  popq %rsi
19    ; CHECK-NEXT:  popq %rdi
20
21    ; PIC-LABEL: Lxray_event_sled_0:
22    ; PIC:       .byte 0xeb, 0x0f
23    ; PIC-NEXT:  pushq %rdi
24    ; PIC-NEXT:  pushq %rsi
25    ; PIC-NEXT:  movq {{.*}}, %rdi
26    ; PIC-NEXT:  movq {{.*}}, %rsi
27    ; PIC-NEXT:  callq __xray_CustomEvent@PLT
28    ; PIC-NEXT:  popq %rsi
29    ; PIC-NEXT:  popq %rdi
30    ret i32 0
31}
32; CHECK-LABEL: xray_instr_map
33; CHECK-LABEL: Lxray_sleds_start0:
34; CHECK:       .quad {{.*}}xray_event_sled_0
35
36declare void @llvm.xray.customevent(i8*, i32)
37