File: dwarf4-duplicate-types.test

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (17 lines) | stat: -rw-r--r-- 1,267 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# REQUIRES: system-linux

# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-duplicate-types-main.s -o %tmain.o
# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-duplicate-types-helper.s -o %thelper.o
# RUN: %clang %cflags %tmain.o %thelper.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-dwarfdump --debug-types %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# LLD does not de-duplicate COMDAT sections for LTO.
# Clang can generate type units with the same hash.
# https://discourse.llvm.org/t/dwarf-different-tu-with-the-same-hash/70095
# Modified helper.s to have the same TU hash with a different COMDAT signature to test this.

# POSTCHECK:          Type Unit: length = 0x00000055, format = DWARF32, version = 0x0004,
# POSTCHECK-SAME:       abbr_offset = 0x0000, addr_size = 0x08, name = 'Foo', type_signature = 0x675d23e4f33235f2, type_offset = 0x001e (next unit at 0x00000059)
# POSTCHECK:          Type Unit: length = 0x00000055, format = DWARF32, version = 0x0004,
# POSTCHECK-SAME:       abbr_offset = 0x0000, addr_size = 0x08, name = 'Foo2a', type_signature = 0x675d23e4f33235f2, type_offset = 0x001e (next unit at 0x000000b2)