File: unused-inlined-params.test

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (48 lines) | stat: -rw-r--r-- 2,989 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# RUN: llvm-mc -filetype=obj %S/Inputs/unused-inlined-params.s \
# RUN:         -triple x86_64-pc-linux -o %t.o
# RUN: %lldb %t.o -s %s -o exit | FileCheck %s


# In this test we verify that inlined functions still mention
# all their parameters in `frame variable`, even when those
# parameters were completely optimized away from the concrete
# instance of the inlined function in the debug info.
# The debugger should look up the parameters in the abstract
# origin of the concrete instance.

# Let us check that unused parameters of an inlined function are listed
# at the inlined function entry.
image lookup -v -s break_at_inlined_f_in_main
# CHECK-LABEL: image lookup -v -s break_at_inlined_f_in_main
# CHECK: name = "unused1", type = "void *", valid ranges = <block>, location = <empty>
# CHECK: name = "used", type = "int", valid ranges = <block>, location = [0x0000000000000011, 0x0000000000000014) -> DW_OP_consts +42
# CHECK: name = "unused2", type = "int", valid ranges = <block>, location = <empty>
# CHECK: name = "partial", type = "int", valid ranges = <block>, location = [0x0000000000000011, 0x0000000000000019) -> DW_OP_reg4 RSI
# CHECK: name = "unused3", type = "int", valid ranges = <block>, location = <empty>

# Show variables outsid of the live range of the 'partial' parameter
# and verify that the output is as expected.
image lookup -v -s break_at_inlined_f_in_main_between_printfs
# CHECK-LABEL: image lookup -v -s break_at_inlined_f_in_main_between_printfs
# CHECK: name = "unused1", type = "void *", valid ranges = <block>, location = <empty>
# CHECK: name = "used", type = "int", valid ranges = <block>, location = [0x0000000000000014, 0x000000000000001e) -> DW_OP_reg3 RBX
# CHECK: name = "unused2", type = "int", valid ranges = <block>, location = <empty>
# Note: image lookup does not show variables outside of their
#       location, so |partial| is missing here.
# CHECK-NOT: partial
# CHECK: name = "unused3", type = "int", valid ranges = <block>, location = <empty>

# Check that we show parameters even if all of them are compiled away.
image lookup -v -s  break_at_inlined_g_in_main
# CHECK-LABEL: image lookup -v -s  break_at_inlined_g_in_main
# CHECK: name = "unused", type = "int", valid ranges = <block>, location = <empty>

# Check that even the other inlined instance of f displays the correct
# parameters.
image lookup -v -s  break_at_inlined_f_in_other
# CHECK-LABEL: image lookup -v -s  break_at_inlined_f_in_other
# CHECK: name = "unused1", type = "void *", valid ranges = <block>, location = <empty>
# CHECK: name = "used", type = "int", valid ranges = <block>, location = [0x0000000000000001, 0x000000000000000b) -> DW_OP_consts +1
# CHECK: name = "unused2", type = "int", valid ranges = <block>, location = <empty>
# CHECK: name = "partial", type = "int", valid ranges = <block>, location = [0x0000000000000001, 0x0000000000000006) -> DW_OP_consts +2
# CHECK: name = "unused3", type = "int", valid ranges = <block>, location = <empty>