File: unused-inlined-params.test

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (48 lines) | stat: -rw-r--r-- 2,989 bytes parent folder | download | duplicates (17)
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>