1 // RUN: dsymutil -f -y %p/dummy-debug-map.map -oso-prepend-path %p/../Inputs/dead-stripped -o - | llvm-dwarfdump - --debug-info | FileCheck %s --implicit-check-not "{{DW_AT_low_pc|DW_AT_high_pc|DW_AT_location|DW_TAG|NULL}}"
3 // RUN: dsymutil --linker llvm -f -y %p/dummy-debug-map.map -oso-prepend-path \
4 // RUN: %p/../Inputs/dead-stripped -o - | llvm-dwarfdump - --debug-info | \
5 // RUN: FileCheck %s --implicit-check-not \
6 // RUN: "{{DW_AT_low_pc|DW_AT_high_pc|DW_AT_location|DW_TAG|NULL}}"
8 // The test was compiled with:
9 // clang++ -O2 -g -c dead-strip.cpp -o 1.o
11 // The goal of the test is to exercise dsymutil's behavior in presence of
12 // functions/variables that have been dead-stripped by the linker but
13 // that are still present in the linked debug info (in this case because
14 // they have been DW_TAG_import'd in another namespace).
16 // Everything in the N namespace below doesn't have a debug map entry, and
17 // thus is considered dead (::foo() has a debug map entry, otherwise dsymutil
18 // would just drop the CU altogether).
20 // CHECK: DW_TAG_compile_unit
21 // CHECK: DW_AT_low_pc
22 // CHECK: DW_AT_high_pc
23 // CHECK: DW_TAG_namespace
26 // CHECK: DW_TAG_variable
27 // CHECK-NOT: DW_AT_location
29 __attribute__((always_inline
)) int foo() { return blah
; }
30 // CHECK: DW_TAG_subprogram
31 // CHECK-NOT: DW_AT_frame_base
33 // CHECK: DW_TAG_subprogram
38 return val
+ bar(i
-1);
41 // CHECK: DW_TAG_subprogram
42 // CHECK-NOT: DW_AT_frame_base
43 // CHECK: DW_TAG_formal_parameter
44 // CHECK: DW_TAG_variable
45 // CHECK: DW_TAG_inlined_subroutine
49 // CHECK: DW_TAG_base_type
50 // CHECK: DW_TAG_imported_module
51 // CHECK: DW_TAG_subprogram
52 // CHECK: DW_AT_low_pc
53 // CHECK: DW_AT_high_pc
54 // CHECK: DW_TAG_base_type