1 // RUN: dsymutil -f -y %p/dummy-debug-map.map -oso-prepend-path \
2 // RUN: %p/../Inputs/inlined-static-variable -o - -keep-function-for-static \
3 // RUN: | llvm-dwarfdump - | FileCheck %s --implicit-check-not \
4 // RUN: "{{DW_AT_low_pc|DW_AT_high_pc|DW_AT_location|DW_TAG|NULL}}" \
5 // RUN: --check-prefixes=CHECK
7 // RUN: dsymutil --linker parallel --no-odr -f -y %p/dummy-debug-map.map \
8 // RUN: -oso-prepend-path %p/../Inputs/inlined-static-variable -o - \
9 // RUN: -keep-function-for-static | llvm-dwarfdump - | FileCheck %s \
10 // RUN: --implicit-check-not \
11 // RUN: "{{DW_AT_low_pc|DW_AT_high_pc|DW_AT_location|DW_TAG|NULL}}" \
12 // RUN: --check-prefixes=CHECK
14 // clang -g -c inlined-static-variable.cpp -o 4.o
16 // The functions removed and not_removed are not in the debug map and are
17 // considered dead, but they are also inlined into the function foo which is
18 // in the debug map. Those function-local globals are alive and thus should
19 // have locations in the debug info even if their functions do not.
21 inline __attribute__((always_inline
)) int removed() {
26 __attribute__((always_inline
)) int not_removed() {
37 return removed() + not_removed();
40 // CHECK: DW_TAG_compile_unit
41 // CHECK: DW_AT_low_pc
42 // CHECK: DW_AT_high_pc
44 // CHECK: DW_TAG_subprogram
45 // CHECK: DW_AT_name ("removed")
46 // CHECK: DW_TAG_variable
47 // CHECK: DW_AT_name ("a")
48 // CHECK: DW_AT_location
51 // CHECK: DW_TAG_base_type
52 // CHECK: DW_TAG_subprogram
53 // CHECK: DW_AT_name ("not_removed")
54 // CHECK: DW_TAG_variable
55 // CHECK: DW_AT_name ("b")
56 // CHECK: DW_AT_location
59 // CHECK: DW_TAG_subprogram
60 // CHECK: DW_AT_low_pc
61 // CHECK: DW_AT_high_pc
62 // CHECK: DW_AT_name ("foo")
63 // CHECK: DW_TAG_inlined_subroutine
64 // CHECK: DW_AT_low_pc
65 // CHECK: DW_AT_high_pc
66 // CHECK: DW_TAG_inlined_subroutine
67 // CHECK: DW_AT_low_pc
68 // CHECK: DW_AT_high_pc