xref: /llvm-project/bolt/test/X86/dwarf4-duplicate-types.test (revision 11791ae7b0b05b8bd8d806331ff51da618912cf8)
1# REQUIRES: system-linux
2
3# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-duplicate-types-main.s -o %tmain.o
4# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-duplicate-types-helper.s -o %thelper.o
5# RUN: %clang %cflags %tmain.o %thelper.o -o %t.exe -Wl,-q
6# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
7# RUN: llvm-dwarfdump --debug-types %t.bolt | FileCheck --check-prefix=POSTCHECK %s
8
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/70095
12## 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