xref: /llvm-project/llvm/test/CodeGen/X86/xray-log-args.ll (revision bef8294650f0119238830d73a7527023c7c8a97f)
1; When logging arguments is specified, emit the entry sled accordingly.
2
3; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX
4; RUN: llc -mtriple=x86_64-darwin-unknown    < %s | FileCheck %s --check-prefixes=CHECK,CHECK-MACOS
5
6define i32 @callee(i32 %arg) nounwind noinline uwtable "function-instrument"="xray-always" "xray-log-args"="1" {
7  ret i32 %arg
8}
9; CHECK-LABEL: callee:
10; CHECK-NEXT:  Lfunc_begin0:
11
12; CHECK-LINUX-LABEL: .Lxray_sleds_start0:
13; CHECK-LINUX-NEXT:  [[TMP:.Ltmp[0-9]+]]:
14; CHECK-LINUX-NEXT:    .quad .Lxray_sled_0-[[TMP]]
15; CHECK-LINUX-NEXT:    .quad .Lfunc_begin0-([[TMP]]+8)
16; CHECK-LINUX-NEXT:    .byte 0x03
17; CHECK-LINUX-NEXT:    .byte 0x01
18; CHECK-LINUX-NEXT:    .byte 0x02
19; CHECK-LINUX:         .zero 13
20; CHECK-LINUX:       [[TMP:.Ltmp[0-9]+]]:
21; CHECK-LINUX-NEXT:    .quad .Lxray_sled_1-[[TMP]]
22; CHECK-LINUX-NEXT:    .quad .Lfunc_begin0-([[TMP]]+8)
23; CHECK-LINUX-NEXT:    .byte 0x01
24; CHECK-LINUX-NEXT:    .byte 0x01
25; CHECK-LINUX-NEXT:    .byte 0x02
26; CHECK-LINUX:         .zero 13
27
28; CHECK-MACOS-LABEL: lxray_sleds_start0:
29; CHECK-MACOS-NEXT:  [[TMP:Ltmp[0-9]+]]:
30; CHECK-MACOS-NEXT:    .quad Lxray_sled_0-[[TMP]]
31; CHECK-MACOS-NEXT:    .quad Lfunc_begin0-([[TMP]]+8)
32; CHECK-MACOS-NEXT:    .byte 0x03
33; CHECK-MACOS-NEXT:    .byte 0x01
34; CHECK-MACOS-NEXT:    .byte 0x02
35; CHECK-MACOS:         .space 13
36; CHECK-MACOS:       [[TMP:Ltmp[0-9]+]]:
37; CHECK-MACOS-NEXT:    .quad Lxray_sled_1-[[TMP]]
38; CHECK-MACOS-NEXT:    .quad Lfunc_begin0-([[TMP]]+8)
39; CHECK-MACOS-NEXT:    .byte 0x01
40; CHECK-MACOS-NEXT:    .byte 0x01
41; CHECK-MACOS-NEXT:    .byte 0x02
42; CHECK-MACOS:         .space 13
43
44define i32 @caller(i32 %arg) nounwind noinline uwtable "function-instrument"="xray-always" "xray-log-args"="1" {
45  %retval = tail call i32 @callee(i32 %arg)
46  ret i32 %retval
47}
48
49; CHECK-LINUX-LABEL: .Lxray_sleds_start1:
50; CHECK-LINUX-NEXT:  [[TMP:.Ltmp[0-9]+]]:
51; CHECK-LINUX-NEXT:    .quad .Lxray_sled_2-[[TMP]]
52; CHECK-LINUX-NEXT:    .quad .Lfunc_begin1-([[TMP]]+8)
53; CHECK-LINUX-NEXT:    .byte 0x03
54; CHECK-LINUX-NEXT:    .byte 0x01
55; CHECK-LINUX-NEXT:    .byte 0x02
56; CHECK-LINUX:         .zero 13
57; CHECK-LINUX:       [[TMP:.Ltmp[0-9]+]]:
58; CHECK-LINUX-NEXT:    .quad .Lxray_sled_3-[[TMP]]
59; CHECK-LINUX-NEXT:    .quad .Lfunc_begin1-([[TMP]]+8)
60; CHECK-LINUX-NEXT:    .byte 0x02
61; CHECK-LINUX-NEXT:    .byte 0x01
62; CHECK-LINUX-NEXT:    .byte 0x02
63; CHECK-LINUX:         .zero 13
64
65; CHECK-MACOS-LABEL: lxray_sleds_start1:
66; CHECK-MACOS-NEXT:  [[TMP:Ltmp[0-9]+]]:
67; CHECK-MACOS-NEXT:    .quad Lxray_sled_2-[[TMP]]
68; CHECK-MACOS-NEXT:    .quad Lfunc_begin1-([[TMP]]+8)
69; CHECK-MACOS-NEXT:    .byte 0x03
70; CHECK-MACOS-NEXT:    .byte 0x01
71; CHECK-MACOS-NEXT:    .byte 0x02
72; CHECK-MACOS:         .space 13
73; CHECK-MACOS:       [[TMP:Ltmp[0-9]+]]:
74; CHECK-MACOS-NEXT:    .quad Lxray_sled_3-[[TMP]]
75; CHECK-MACOS-NEXT:    .quad Lfunc_begin1-([[TMP]]+8)
76; CHECK-MACOS-NEXT:    .byte 0x02
77; CHECK-MACOS-NEXT:    .byte 0x01
78; CHECK-MACOS-NEXT:    .byte 0x02
79; CHECK-MACOS:         .space 13
80