File: unused-inlined-params.test

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-16
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,496,368 kB
  • sloc: cpp: 5,593,980; ansic: 986,873; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,547; xml: 953; cs: 573; fortran: 567
file content (48 lines) | stat: -rw-r--r-- 2,410 bytes parent folder | download | duplicates (3)
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 *", location = <empty>
# CHECK: name = "used", type = "int", location = DW_OP_consts +42
# CHECK: name = "unused2", type = "int", location = <empty>
# CHECK: name = "partial", type = "int", location = DW_OP_reg4 RSI
# CHECK: name = "unused3", type = "int", 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 *", location = <empty>
# CHECK: name = "used", type = "int", location = DW_OP_reg3 RBX
# CHECK: name = "unused2", type = "int", 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", 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", 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 *", location = <empty>
# CHECK: name = "used", type = "int", location = DW_OP_consts +1
# CHECK: name = "unused2", type = "int", location = <empty>
# CHECK: name = "partial", type = "int", location =  DW_OP_consts +2
# CHECK: name = "unused3", type = "int", location = <empty>