Unverified Commit 2548c010 authored by Jonas Devlieghere's avatar Jonas Devlieghere Committed by GitHub
Browse files

[dsymutil] Make --linker explicit in every test (#195293)

Pass `--linker classic` or `--linker parallel` on every `dsymutil`
invocation instead of relying on the implicit default. This preserves
the existing coverage in preparation for toggling the default in the
future.

Tests previously exercising only one linker now mirror the RUN block for
the other, sharing FileCheck prefixes. Not all tests are compatible, and
I've added a FIXME to make them easy to spot.
parent 4ff87c01
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
RUN: dsymutil -accelerator=Dwarf -oso-prepend-path=%p/../Inputs %p/../Inputs/accel-imported-declaration.macho-arm64 -o %t.dwarf.dSYM
RUN: dsymutil -accelerator=Apple -oso-prepend-path=%p/../Inputs %p/../Inputs/accel-imported-declaration.macho-arm64 -o %t.apple.dSYM
RUN: dsymutil --linker classic -accelerator=Dwarf -oso-prepend-path=%p/../Inputs %p/../Inputs/accel-imported-declaration.macho-arm64 -o %t.dwarf.dSYM
RUN: dsymutil --linker classic -accelerator=Apple -oso-prepend-path=%p/../Inputs %p/../Inputs/accel-imported-declaration.macho-arm64 -o %t.apple.dSYM

RUN: llvm-dwarfdump -v %t.dwarf.dSYM | FileCheck %s -check-prefixes=DWARF,COMMON
RUN: llvm-dwarfdump -v %t.apple.dSYM | FileCheck %s -check-prefixes=APPLE,COMMON

## FIXME: Support --linker parallel

COMMON: .debug_info contents
COMMON: {{.*}}DW_TAG_namespace
COMMON:   DW_AT_name{{.*}}"A"
+54 −10
Original line number Diff line number Diff line
# Test --allow to include one object file (1.o).
RUN: dsymutil --dump-debug-map \
RUN: dsymutil --linker classic --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --oso-prepend-path=%p/../Inputs \
RUN:   --allow=%p/../Inputs/allow-disallow/one.yaml \
RUN:   | FileCheck %s --check-prefix=ALLOW-ONE
RUN: dsymutil --linker parallel --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --oso-prepend-path=%p/../Inputs \
RUN:   --allow=%p/../Inputs/allow-disallow/one.yaml \
RUN:   | FileCheck %s --check-prefix=ALLOW-ONE

# Test --allow to include two object files (1.o and 3.o).
RUN: dsymutil --dump-debug-map \
RUN: dsymutil --linker classic --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --oso-prepend-path=%p/../Inputs \
RUN:   --allow=%p/../Inputs/allow-disallow/two.yaml \
RUN:   | FileCheck %s --check-prefix=ALLOW-TWO
RUN: dsymutil --linker parallel --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --oso-prepend-path=%p/../Inputs \
RUN:   --allow=%p/../Inputs/allow-disallow/two.yaml \
RUN:   | FileCheck %s --check-prefix=ALLOW-TWO

# Test --allow to include no object files (empty allow list).
RUN: dsymutil --dump-debug-map \
RUN: dsymutil --linker classic --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --oso-prepend-path=%p/../Inputs \
RUN:   --allow=%p/../Inputs/allow-disallow/empty.yaml \
RUN:   | FileCheck %s --check-prefix=ALLOW-NONE
RUN: dsymutil --linker parallel --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --oso-prepend-path=%p/../Inputs \
RUN:   --allow=%p/../Inputs/allow-disallow/empty.yaml \
RUN:   | FileCheck %s --check-prefix=ALLOW-NONE

# Test --disallow to exclude one object file (1.o).
RUN: dsymutil --dump-debug-map \
RUN: dsymutil --linker classic --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --oso-prepend-path=%p/../Inputs \
RUN:   --disallow=%p/../Inputs/allow-disallow/one.yaml \
RUN:   | FileCheck %s --check-prefix=DISALLOW-ONE
RUN: dsymutil --linker parallel --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --oso-prepend-path=%p/../Inputs \
RUN:   --disallow=%p/../Inputs/allow-disallow/one.yaml \
RUN:   | FileCheck %s --check-prefix=DISALLOW-ONE

# Test --disallow to exclude two object files (1.o and 3.o).
RUN: dsymutil --dump-debug-map \
RUN: dsymutil --linker classic --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --oso-prepend-path=%p/../Inputs \
RUN:   --disallow=%p/../Inputs/allow-disallow/two.yaml \
RUN:   | FileCheck %s --check-prefix=DISALLOW-TWO
RUN: dsymutil --linker parallel --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --oso-prepend-path=%p/../Inputs \
RUN:   --disallow=%p/../Inputs/allow-disallow/two.yaml \
RUN:   | FileCheck %s --check-prefix=DISALLOW-TWO

# Test --disallow to exclude no object files (empty allow list).
RUN: dsymutil --dump-debug-map \
RUN: dsymutil --linker classic --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --oso-prepend-path=%p/../Inputs \
RUN:   --disallow=%p/../Inputs/allow-disallow/empty.yaml \
RUN:   | FileCheck %s --check-prefix=DISALLOW-NONE
RUN: dsymutil --linker parallel --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --oso-prepend-path=%p/../Inputs \
RUN:   --disallow=%p/../Inputs/allow-disallow/empty.yaml \
RUN:   | FileCheck %s --check-prefix=DISALLOW-NONE

# Test error when allow-list file does not exist.
RUN: not dsymutil --dump-debug-map \
RUN: not dsymutil --linker classic --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --allow=/nonexistent/path 2>&1 \
RUN:   | FileCheck %s --check-prefix=MISSING-FILE
RUN: not dsymutil --linker parallel --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --allow=/nonexistent/path 2>&1 \
RUN:   | FileCheck %s --check-prefix=MISSING-FILE

# Test error when disallow-list file does not exist.
RUN: not dsymutil --dump-debug-map \
RUN: not dsymutil --linker classic --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --disallow=/nonexistent/path 2>&1 \
RUN:   | FileCheck %s --check-prefix=MISSING-FILE
RUN: not dsymutil --linker parallel --dump-debug-map \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 \
RUN:   --disallow=/nonexistent/path 2>&1 \
RUN:   | FileCheck %s --check-prefix=MISSING-FILE

# Test error when combined with -y.
RUN: not dsymutil --allow=some.file.yaml \
RUN: not dsymutil --linker classic --allow=some.file.yaml \
RUN:   -y %p/../Inputs/remarks/basic.macho.remarks.arm64 2>&1 \
RUN:   | FileCheck %s --check-prefix=YAML-CONFLICT
RUN: not dsymutil --linker parallel --allow=some.file.yaml \
RUN:   -y %p/../Inputs/remarks/basic.macho.remarks.arm64 2>&1 \
RUN:   | FileCheck %s --check-prefix=YAML-CONFLICT

# Test error when --allow and --disallow are both specified.
RUN: not dsymutil --allow=some.file.yaml --disallow=some.file.yaml \
RUN: not dsymutil --linker classic --allow=some.file.yaml --disallow=some.file.yaml \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 2>&1 \
RUN:   | FileCheck %s --check-prefix=ALLOW-DISALLOW-CONFLICT
RUN: not dsymutil --linker parallel --allow=some.file.yaml --disallow=some.file.yaml \
RUN:   %p/../Inputs/allow-disallow/a.out.arm64 2>&1 \
RUN:   | FileCheck %s --check-prefix=ALLOW-DISALLOW-CONFLICT

+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ int __attribute__((disable_tail_calls)) main() {
$ clang -arch arm64 main.cpp -o main.arm64.o -c -g -O2
$ clang -arch arm64 main.arm64.o -o main.arm64 -g

RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/call_pc/main.arm64 -o %t.dSYM
RUN: dsymutil --linker classic -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/call_pc/main.arm64 -o %t.dSYM
RUN: llvm-dwarfdump %t.dSYM | FileCheck %s -implicit-check-not=DW_AT_call_pc

RUN: dsymutil --linker parallel -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/call_pc/main.arm64 -o %t.dSYM
+2 −2
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@


RUN: rm -rf %t.dir && mkdir -p %t.dir
RUN: dsymutil -y %p/dummy-debug-map-arm64.map -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base -o %t.dir/dwarf5-addr-base.dSYM
RUN: dsymutil --linker classic -y %p/dummy-debug-map-arm64.map -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base -o %t.dir/dwarf5-addr-base.dSYM
RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | FileCheck %s

RUN: rm -rf %t.dir && mkdir -p %t.dir
@@ -64,7 +64,7 @@ RUN: FileCheck %s --check-prefixes=CHECK,CHECK-LLVM


RUN: rm -rf %t.dir && mkdir -p %t.dir
RUN: dsymutil --update -y %p/dummy-debug-map-arm64.map -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base -o %t.dir/dwarf5-addr-base.dSYM
RUN: dsymutil --linker classic --update -y %p/dummy-debug-map-arm64.map -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base -o %t.dir/dwarf5-addr-base.dSYM
RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | FileCheck %s --check-prefix=UPD

RUN: rm -rf %t.dir && mkdir -p %t.dir
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ DEBUGADDR: 0x0000000000000059
DEBUGADDR: 0x0000000000000000
DEBUGADDR: ]

RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/dwarf5/dwarf5-addrx-0x0-last.out -o %t.dSYM 2>&1 | FileCheck %s --allow-empty
RUN: dsymutil --linker classic -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/dwarf5/dwarf5-addrx-0x0-last.out -o %t.dSYM 2>&1 | FileCheck %s --allow-empty
RUN: llvm-dwarfdump --verify %t.dSYM 2>&1 | FileCheck %s
RUN: llvm-dwarfdump --verbose -debug-info %t.dSYM | FileCheck %s --check-prefix DEBUGINFO
RUN: llvm-dwarfdump --verbose -debug-line %t.dSYM | FileCheck %s --check-prefix DEBUGLINE
Loading