49 lines · plain
1# RUN: llvm-mc -filetype=obj %S/Inputs/unused-inlined-params.s \2# RUN: -triple x86_64-pc-linux -o %t.o3# RUN: %lldb %t.o -s %s -o exit | FileCheck %s4 5 6# In this test we verify that inlined functions still mention7# all their parameters in `frame variable`, even when those8# parameters were completely optimized away from the concrete9# instance of the inlined function in the debug info.10# The debugger should look up the parameters in the abstract11# origin of the concrete instance.12 13# Let us check that unused parameters of an inlined function are listed14# at the inlined function entry.15image lookup -v -s break_at_inlined_f_in_main16# CHECK-LABEL: image lookup -v -s break_at_inlined_f_in_main17# CHECK: name = "unused1", type = "void *", valid ranges = <block>, location = <empty>18# CHECK: name = "used", type = "int", valid ranges = <block>, location = [0x0000000000000011, 0x0000000000000014) -> DW_OP_consts +4219# CHECK: name = "unused2", type = "int", valid ranges = <block>, location = <empty>20# CHECK: name = "partial", type = "int", valid ranges = <block>, location = [0x0000000000000011, 0x0000000000000019) -> DW_OP_reg4 RSI21# CHECK: name = "unused3", type = "int", valid ranges = <block>, location = <empty>22 23# Show variables outsid of the live range of the 'partial' parameter24# and verify that the output is as expected.25image lookup -v -s break_at_inlined_f_in_main_between_printfs26# CHECK-LABEL: image lookup -v -s break_at_inlined_f_in_main_between_printfs27# CHECK: name = "unused1", type = "void *", valid ranges = <block>, location = <empty>28# CHECK: name = "used", type = "int", valid ranges = <block>, location = [0x0000000000000014, 0x000000000000001e) -> DW_OP_reg3 RBX29# CHECK: name = "unused2", type = "int", valid ranges = <block>, location = <empty>30# Note: image lookup does not show variables outside of their31# location, so |partial| is missing here.32# CHECK-NOT: partial33# CHECK: name = "unused3", type = "int", valid ranges = <block>, location = <empty>34 35# Check that we show parameters even if all of them are compiled away.36image lookup -v -s break_at_inlined_g_in_main37# CHECK-LABEL: image lookup -v -s break_at_inlined_g_in_main38# CHECK: name = "unused", type = "int", valid ranges = <block>, location = <empty>39 40# Check that even the other inlined instance of f displays the correct41# parameters.42image lookup -v -s break_at_inlined_f_in_other43# CHECK-LABEL: image lookup -v -s break_at_inlined_f_in_other44# CHECK: name = "unused1", type = "void *", valid ranges = <block>, location = <empty>45# CHECK: name = "used", type = "int", valid ranges = <block>, location = [0x0000000000000001, 0x000000000000000b) -> DW_OP_consts +146# CHECK: name = "unused2", type = "int", valid ranges = <block>, location = <empty>47# CHECK: name = "partial", type = "int", valid ranges = <block>, location = [0x0000000000000001, 0x0000000000000006) -> DW_OP_consts +248# CHECK: name = "unused3", type = "int", valid ranges = <block>, location = <empty>49