18 lines · plain
1# REQUIRES: system-linux2 3# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-duplicate-types-main.s -o %tmain.o4# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-duplicate-types-helper.s -o %thelper.o5# RUN: %clang %cflags %tmain.o %thelper.o -o %t.exe -Wl,-q6# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections7# RUN: llvm-dwarfdump --debug-types %t.bolt | FileCheck --check-prefix=POSTCHECK %s8 9## LLD does not de-duplicate COMDAT sections for LTO.10## Clang can generate type units with the same hash.11## https://discourse.llvm.org/t/dwarf-different-tu-with-the-same-hash/7009512## Modified helper.s to have the same TU hash with a different COMDAT signature to test this.13 14# POSTCHECK: Type Unit: length = 0x00000055, format = DWARF32, version = 0x0004,15# POSTCHECK-SAME: abbr_offset = 0x0000, addr_size = 0x08, name = 'Foo', type_signature = 0x675d23e4f33235f2, type_offset = 0x001e (next unit at 0x00000059)16# POSTCHECK: Type Unit: length = 0x00000055, format = DWARF32, version = 0x0004,17# POSTCHECK-SAME: abbr_offset = 0x0000, addr_size = 0x08, name = 'Foo2a', type_signature = 0x675d23e4f33235f2, type_offset = 0x001e (next unit at 0x000000b2)18