File: unused-inlined-params.test

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (48 lines) | stat: -rw-r--r-- 2,989 bytes parent folder | download | duplicates (13)
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>