1 // RUN: dsymutil -f -y %p/dummy-debug-map.map -oso-prepend-path %p/../Inputs/inlined-static-variable -o - | llvm-dwarfdump - | FileCheck %s --implicit-check-not "{{DW_AT_low_pc|DW_AT_high_pc|DW_AT_location|DW_TAG|NULL}}"
3 // clang -g -c inlined-static-variable.cpp -o 4.o
5 // The functions removed and not_removed are not in the debug map and are
6 // considered dead, but they are also inlined into the function foo which is
7 // in the debug map. Those function-local globals are alive and thus should
8 // have locations in the debug info even if their functions do not.
10 inline __attribute__((always_inline
)) int removed() {
15 __attribute__((always_inline
)) int not_removed() {
26 return removed() + not_removed();
29 // CHECK: DW_TAG_compile_unit
30 // CHECK: DW_AT_low_pc
31 // CHECK: DW_AT_high_pc
33 // CHECK: DW_TAG_subprogram
34 // CHECK: DW_AT_name ("removed")
35 // CHECK: DW_TAG_variable
36 // CHECK: DW_AT_name ("a")
37 // CHECK: DW_AT_location
40 // CHECK: DW_TAG_base_type
41 // CHECK: DW_TAG_subprogram
42 // CHECK: DW_AT_name ("not_removed")
43 // CHECK: DW_TAG_variable
44 // CHECK: DW_AT_name ("b")
45 // CHECK: DW_AT_location
48 // CHECK: DW_TAG_subprogram
49 // CHECK: DW_AT_low_pc
50 // CHECK: DW_AT_high_pc
51 // CHECK: DW_AT_name ("foo")
52 // CHECK: DW_TAG_inlined_subroutine
53 // CHECK: DW_AT_low_pc
54 // CHECK: DW_AT_high_pc
55 // CHECK: DW_TAG_inlined_subroutine
56 // CHECK: DW_AT_low_pc
57 // CHECK: DW_AT_high_pc