| 1 |
#RUN: dsymutil --linker=parallel -f -oso-prepend-path=%p/../Inputs/ -y %s -o %t.dwarf |
| 2 |
#RUN: llvm-dwarfdump %t.dwarf | FileCheck %s |
| 3 |
|
| 4 |
# There should be two typedef DIE named "BarInt" in the resultant .dwarf file. |
| 5 |
# The second should refer to the first, which refer to "Foo<int>". |
| 6 |
# CHECK: 0x[[FIRST_BARINT_ADDR:[0-9a-f]*]]: DW_TAG_typedef |
| 7 |
# CHECK-NEXT: DW_AT_type (0x{{([[:xdigit:]]*)}} "Foo<int>") |
| 8 |
# CHECK-NEXT: DW_AT_name ("BarInt") |
| 9 |
# CHECK: 0x{{([[:xdigit:]]*)}}: DW_TAG_typedef |
| 10 |
# CHECK-NEXT: DW_AT_type (0x[[FIRST_BARINT_ADDR]] "BarInt") |
| 11 |
# CHECK-NEXT: DW_AT_name ("BarInt") |
| 12 |
|
| 13 |
# Source: |
| 14 |
# |
| 15 |
# template <typename T> struct Foo; |
| 16 |
# typedef Foo<int> BarInt; |
| 17 |
# template <typename T> |
| 18 |
# struct [[clang::preferred_name(BarInt)]] Foo{}; |
| 19 |
# int main() { |
| 20 |
# BarInt barInt; |
| 21 |
# return 0; |
| 22 |
# } |
| 23 |
# |
| 24 |
# Compile with: |
| 25 |
# |
| 26 |
# $ clang++ -g -O0 -c typedefs-with-same-name.cpp -o typedefs-with-same-name.o |
| 27 |
# |
| 28 |
# To generate the debug map: |
| 29 |
# |
| 30 |
# $ clang++ typedefs-with-same-name.o -o typedefs-with-same-name |
| 31 |
# $ dsymutil -dump-debug-map typedefs-with-same-name |
| 32 |
|
| 33 |
--- |
| 34 |
triple: 'arm64-apple-darwin' |
| 35 |
objects: |
| 36 |
- filename: '/typedefs-with-same-name.o' |
| 37 |
timestamp: 1762438746 |
| 38 |
type: 102 |
| 39 |
symbols: |
| 40 |
- { sym: _main, objAddr: 0x0, binAddr: 0x100000360, size: 0x14 } |
| 41 |
... |