Skip to content

Commit f3a8655

Browse files
committed
fixup! add test
1 parent d40f932 commit f3a8655

File tree

8 files changed

+51
-0
lines changed

8 files changed

+51
-0
lines changed

llvm/test/tools/dsymutil/AArch64/dummy-debug-map-arm64.map

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ objects:
1111
- filename: 1.o
1212
symbols:
1313
- { sym: _bar, objAddr: 0x0, binAddr: 0x10000, size: 0x10 }
14+
- { sym: __Z13lib1_internalv, objAddr: 0x0, binAddr: 0x10020, size: 0x20 }
15+
- { sym: __ZN3Foo4funcIZ13lib1_internalvE3$_0EEvv, objAddr: 0x0, binAddr: 0x10040, size: 0x20 }
1416
- filename: 2.o
1517
symbols:
1618
- { sym: __Z3foov, objAddr: 0x0, binAddr: 0x20000, size: 0x10 }
19+
- { sym: __Z13lib1_internalv, objAddr: 0x0, binAddr: 0x20020, size: 0x20 }
20+
- { sym: __ZN3Foo4funcIZ13lib1_internalvE3$_0EEvv, objAddr: 0x0, binAddr: 0x20040, size: 0x20 }
1721
- filename: 3.o
1822
symbols:
1923
- { sym: __Z3foov, objAddr: 0x0, binAddr: 0x30000, size: 0x10 }
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Tests the case where a DW_TAG_subprogram for a method declaration
2+
# got uniqued into a DW_TAG_subprogram with the same linkage name (but
3+
# different DW_AT_name). Make sure the DW_TAG_subprogram DIE for the
4+
# definition, which previously pointed to the now de-deduplicated declaration,
5+
# gets inserted into the .debug_names table using the DW_AT_name of the canonical
6+
# declaration DW_TAG_subprogram.
7+
#
8+
# Object files compiled as follows:
9+
# clang -g -c -o 1.o Inputs/odr-uniquing-DW_AT_name-conflict/lib1.cpp
10+
# clang -g -c -o 2.o Inputs/odr-uniquing-DW_AT_name-conflict/lib2.cpp
11+
12+
# RUN: dsymutil -f -oso-prepend-path=%p/../Inputs/odr-uniquing-DW_AT_name-conflict -y %p/dummy-debug-map-arm64.map -o - \
13+
# RUN: | llvm-dwarfdump --verify - | FileCheck %s
14+
15+
# RUN: dsymutil --linker parallel -f -oso-prepend-path=%p/../Inputs/odr-uniquing-DW_AT_name-conflict -y %p/dummy-debug-map-arm64.map -o - \
16+
# RUN: | not llvm-dwarfdump --verify - | FileCheck %s --check-prefix=PARALLEL-ODR
17+
18+
# RUN: dsymutil -f -oso-prepend-path=%p/../Inputs/odr-uniquing-DW_AT_name-conflict -y %p/dummy-debug-map-arm64.map -no-odr -o - \
19+
# RUN: | llvm-dwarfdump --verify - | FileCheck %s
20+
21+
# RUN: dsymutil --linker parallel -f -oso-prepend-path=%p/../Inputs/odr-uniquing-DW_AT_name-conflict -y %p/dummy-debug-map-arm64.map -no-odr -o - \
22+
# RUN: | llvm-dwarfdump --verify - | FileCheck %s
23+
24+
# CHECK: No errors.
25+
26+
# FIXME: parallel DWARFLinker uses wrong DW_AT_name when inserting uniqued subprogram into .debug_names
27+
# PARALLEL-ODR: Verifying .debug_names...
28+
# PARALLEL-ODR-NEXT: error: Name Index {{.*}} mismatched Name of DIE
Binary file not shown.
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include "lib1.h"
2+
3+
[[gnu::weak]] void lib1_internal() {
4+
Foo{}.func<decltype([]{})>();
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
struct Foo {
2+
template<typename T> void func() {}
3+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include "lib1.h"
2+
3+
[[gnu::weak]] void lib1_internal() {
4+
Foo{}.func<decltype([]{})>();
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[[gnu::weak]] void lib1_internal();
2+
3+
int main() {
4+
lib1_internal();
5+
__builtin_debugtrap();
6+
}

0 commit comments

Comments
 (0)