This file was deleted.

This file was deleted.

This file was deleted.

27 changes: 26 additions & 1 deletion llvm/test/tools/dsymutil/X86/basic-linking-bundle.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RUN: rm -rf %t
RUN: mkdir -p %t/dsymdest
RUN: cat %p/../Inputs/basic.macho.x86_64 > %t/basic.macho.x86_64
RUN: cp %p/../Inputs/basic.macho.x86_64 %t/basic.macho.x86_64

RUN: dsymutil -accelerator=Pub -oso-prepend-path=%p/.. %t/basic.macho.x86_64

Expand All @@ -19,6 +19,31 @@ RUN: dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64 -o %t/dsymdest/basic
RUN: llvm-dwarfdump -a %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test
RUN: FileCheck %s --input-file %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Info.plist

### --------------------------------------------
### Repeat the steps for --linker llvm

RUN: rm -rf %t
RUN: mkdir -p %t/dsymdest
RUN: cp %p/../Inputs/basic.macho.x86_64 %t/basic.macho.x86_64

RUN: dsymutil --linker llvm -accelerator=Pub -oso-prepend-path=%p/.. %t/basic.macho.x86_64

Check that the object file in the bundle exists and is sane:
RUN: llvm-dwarfdump -a %t/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test

Check that we don't create an empty Remarks directory if there are no remarks.
RUN: not ls %t/basic.macho.x86_64.dSYM/Contents/Resources/Remarks

Check that llvm-dwarfdump -a recognizes the bundle as a dSYM:
RUN: llvm-dwarfdump -a %t/basic.macho.x86_64.dSYM | FileCheck %S/basic-linking-x86.test

RUN: FileCheck %s --input-file %t/basic.macho.x86_64.dSYM/Contents/Info.plist

RUN: dsymutil --linker llvm -oso-prepend-path=%p/.. %t/basic.macho.x86_64 \
RUN: -o %t/dsymdest/basic.macho.x86_64.dSYM
RUN: llvm-dwarfdump -a %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test
RUN: FileCheck %s --input-file %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Info.plist

CHECK: <?xml version="1.0" encoding="UTF-8"?>
CHECK-NEXT: <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
CHECK-NEXT: <plist version="1.0">
Expand Down
47 changes: 41 additions & 6 deletions llvm/test/tools/dsymutil/X86/basic-linking-x86.test
Original file line number Diff line number Diff line change
@@ -1,12 +1,47 @@
RUN: cat %p/../Inputs/basic.macho.x86_64 > %t1
RUN: cp %p/../Inputs/basic.macho.x86_64 %t1
RUN: dsymutil -accelerator=Pub -f -oso-prepend-path=%p/.. %t1
RUN: llvm-dwarfdump -a %t1.dwarf | FileCheck %s
RUN: dsymutil -accelerator=Pub -f -o %t2 -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64
RUN: dsymutil -accelerator=Pub -f -o %t2 -oso-prepend-path=%p/.. \
RUN: %p/../Inputs/basic.macho.x86_64
RUN: llvm-dwarfdump -a %t2 | FileCheck %s
RUN: dsymutil -accelerator=Pub -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s --check-prefixes=CHECK,BASIC,PUB
RUN: dsymutil -accelerator=Pub -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s --check-prefixes=CHECK,ARCHIVE,PUB
RUN: dsymutil -accelerator=Pub -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | dsymutil -accelerator=Pub -f -y -o - - | llvm-dwarfdump -a - | FileCheck %s --check-prefixes=CHECK,BASIC,PUB
RUN: dsymutil -accelerator=Pub -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | dsymutil -accelerator=Pub -f -o - -y - | llvm-dwarfdump -a - | FileCheck %s --check-prefixes=CHECK,ARCHIVE,PUB
RUN: dsymutil -accelerator=Pub -f -o - -oso-prepend-path=%p/.. \
RUN: %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | \
RUN: FileCheck %s --check-prefixes=CHECK,BASIC,PUB
RUN: dsymutil -accelerator=Pub -f -o - -oso-prepend-path=%p/.. \
RUN: %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump -a - \
RUN: | FileCheck %s --check-prefixes=CHECK,ARCHIVE,PUB
RUN: dsymutil -accelerator=Pub -dump-debug-map -oso-prepend-path=%p/.. \
RUN: %p/../Inputs/basic.macho.x86_64 | dsymutil -accelerator=Pub -f -y \
RUN: -o - - | llvm-dwarfdump -a - | FileCheck %s \
RUN: --check-prefixes=CHECK,BASIC,PUB
RUN: dsymutil -accelerator=Pub -dump-debug-map -oso-prepend-path=%p/.. \
RUN: %p/../Inputs/basic-archive.macho.x86_64 | dsymutil -accelerator=Pub \
RUN: -f -o - -y - | llvm-dwarfdump -a - | FileCheck %s \
RUN: --check-prefixes=CHECK,ARCHIVE,PUB

### ---------------------------------------
### Repeat the same steps for --linker llvm

RUN: cp %p/../Inputs/basic.macho.x86_64 %t1
RUN: dsymutil --linker llvm -accelerator=Pub -f -oso-prepend-path=%p/.. %t1
RUN: llvm-dwarfdump -a %t1.dwarf | FileCheck %s
RUN: dsymutil --linker llvm -accelerator=Pub -f -o %t2 -oso-prepend-path=%p/.. \
RUN: %p/../Inputs/basic.macho.x86_64
RUN: llvm-dwarfdump -a %t2 | FileCheck %s
RUN: dsymutil --linker llvm -accelerator=Pub -f -o - -oso-prepend-path=%p/.. \
RUN: %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | \
RUN: FileCheck %s --check-prefixes=CHECK,BASIC,PUB
RUN: dsymutil --linker llvm -accelerator=Pub -f -o - -oso-prepend-path=%p/.. \
RUN: %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump -a - | \
RUN: FileCheck %s --check-prefixes=CHECK,ARCHIVE,PUB
RUN: dsymutil --linker llvm -accelerator=Pub -dump-debug-map \
RUN: -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 \
RUN: | dsymutil -accelerator=Pub -f -y -o - - | llvm-dwarfdump \
RUN: -a - | FileCheck %s --check-prefixes=CHECK,BASIC,PUB
RUN: dsymutil --linker llvm -accelerator=Pub -dump-debug-map \
RUN: -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 \
RUN: | dsymutil -accelerator=Pub -f -o - -y - | llvm-dwarfdump -a - | \
RUN: FileCheck %s --check-prefixes=CHECK,ARCHIVE,PUB

CHECK: file format Mach-O 64-bit x86-64

Expand Down
4 changes: 4 additions & 0 deletions llvm/test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
RUN: dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto-dw4.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s

RUN: dsymutil --linker llvm -f -o - -oso-prepend-path=%p/.. \
RUN: %p/../Inputs/basic-lto-dw4.macho.x86_64 | llvm-dwarfdump -a - \
RUN: | FileCheck %s

CHECK: file format Mach-O 64-bit x86-64

CHECK: debug_info contents
Expand Down
6 changes: 6 additions & 0 deletions llvm/test/tools/dsymutil/X86/basic-lto-linking-x86.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
RUN: dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s
RUN: dsymutil -oso-prepend-path=%p/.. -dump-debug-map %p/../Inputs/basic-lto.macho.x86_64 | dsymutil -f -o - -y - | llvm-dwarfdump -a - | FileCheck %s

RUN: dsymutil --linker llvm -f -o - -oso-prepend-path=%p/.. \
RUN: %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s
RUN: dsymutil --linker llvm -oso-prepend-path=%p/.. -dump-debug-map \
RUN: %p/../Inputs/basic-lto.macho.x86_64 | dsymutil -f -o - -y - | \
RUN: llvm-dwarfdump -a - | FileCheck %s

CHECK: file format Mach-O 64-bit x86-64

CHECK: debug_info contents
Expand Down
6 changes: 5 additions & 1 deletion llvm/test/tools/dsymutil/X86/basic-with-libfat-test.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
RUN: dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-with-libfat-test.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
RUN: dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-with-libfat-test.macho.x86_64 | llvm-dwarfdump - | FileCheck %s

RUN: dsymutil --linker llvm -f -o - -oso-prepend-path=%p/.. \
RUN: %p/../Inputs/basic-with-libfat-test.macho.x86_64 | llvm-dwarfdump - \
RUN: | FileCheck %s

The test binary was created by force-linking the libfat-test.a fat archive
with the basic linking test archive, like so:
Expand Down
45 changes: 42 additions & 3 deletions llvm/test/tools/dsymutil/X86/multiple-inputs.test
Original file line number Diff line number Diff line change
@@ -1,13 +1,47 @@
RUN: rm -rf %t
RUN: mkdir -p %t

RUN: cp %p/../Inputs/basic.macho.x86_64 %t/basic.macho.x86_64
RUN: cp %p/../Inputs/basic-archive.macho.x86_64 %t/basic-archive.macho.x86_64
RUN: cp %p/../Inputs/basic-lto.macho.x86_64 %t/basic-lto.macho.x86_64
RUN: cp %p/../Inputs/basic-lto-dw4.macho.x86_64 %t/basic-lto-dw4.macho.x86_64

# Multiple inputs in flat mode
RUN: dsymutil -f -oso-prepend-path=%p/.. %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64
RUN: llvm-dwarfdump -a %t/basic.macho.x86_64.dwarf \
RUN: | FileCheck %S/basic-linking-x86.test --check-prefixes=CHECK,BASIC
RUN: llvm-dwarfdump -a %t/basic-archive.macho.x86_64.dwarf \
RUN: | FileCheck %S/basic-linking-x86.test --check-prefixes=CHECK,ARCHIVE
RUN: llvm-dwarfdump -a %t/basic-lto.macho.x86_64.dwarf | FileCheck %S/basic-lto-linking-x86.test
RUN: llvm-dwarfdump -a %t/basic-lto-dw4.macho.x86_64.dwarf | FileCheck %S/basic-lto-dw4-linking-x86.test

# Multiple inputs that end up in the same named bundle
RUN: dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64 -o %t.dSYM
RUN: llvm-dwarfdump -a %t.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 \
RUN: | FileCheck %S/basic-linking-x86.test --check-prefixes=CHECK,BASIC
RUN: llvm-dwarfdump -a %t.dSYM/Contents/Resources/DWARF/basic-archive.macho.x86_64 \
RUN: | FileCheck %S/basic-linking-x86.test --check-prefixes=CHECK,ARCHIVE
RUN: llvm-dwarfdump -a %t.dSYM/Contents/Resources/DWARF/basic-lto.macho.x86_64 | FileCheck %S/basic-lto-linking-x86.test
RUN: llvm-dwarfdump -a %t.dSYM/Contents/Resources/DWARF/basic-lto-dw4.macho.x86_64 | FileCheck %S/basic-lto-dw4-linking-x86.test

# Multiple inputs in a named bundle in flat mode... impossible.
RUN: not dsymutil -f -oso-prepend-path=%p/.. %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64 -o %t.dSYM 2>&1 | FileCheck %s

## ---------------------------------------
## Repeat the same steps for --linker llvm

RUN: rm -rf %t
RUN: mkdir -p %t

RUN: cat %p/../Inputs/basic.macho.x86_64 > %t/basic.macho.x86_64
RUN: cat %p/../Inputs/basic-archive.macho.x86_64 > %t/basic-archive.macho.x86_64
RUN: cat %p/../Inputs/basic-lto.macho.x86_64 > %t/basic-lto.macho.x86_64
RUN: cat %p/../Inputs/basic-lto-dw4.macho.x86_64 > %t/basic-lto-dw4.macho.x86_64

# Multiple inputs in flat mode
RUN: dsymutil -f -oso-prepend-path=%p/.. %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64
RUN: dsymutil --linker llvm -f -oso-prepend-path=%p/.. \
RUN: %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 \
RUN: %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64
RUN: llvm-dwarfdump -a %t/basic.macho.x86_64.dwarf \
RUN: | FileCheck %S/basic-linking-x86.test --check-prefixes=CHECK,BASIC
RUN: llvm-dwarfdump -a %t/basic-archive.macho.x86_64.dwarf \
Expand All @@ -16,7 +50,9 @@ RUN: llvm-dwarfdump -a %t/basic-lto.macho.x86_64.dwarf | FileCheck %S/basic-lto-
RUN: llvm-dwarfdump -a %t/basic-lto-dw4.macho.x86_64.dwarf | FileCheck %S/basic-lto-dw4-linking-x86.test

# Multiple inputs that end up in the same named bundle
RUN: dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64 -o %t.dSYM
RUN: dsymutil --linker llvm -oso-prepend-path=%p/.. %t/basic.macho.x86_64 \
RUN: %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 \
RUN: %t/basic-lto-dw4.macho.x86_64 -o %t.dSYM
RUN: llvm-dwarfdump -a %t.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 \
RUN: | FileCheck %S/basic-linking-x86.test --check-prefixes=CHECK,BASIC
RUN: llvm-dwarfdump -a %t.dSYM/Contents/Resources/DWARF/basic-archive.macho.x86_64 \
Expand All @@ -25,6 +61,9 @@ RUN: llvm-dwarfdump -a %t.dSYM/Contents/Resources/DWARF/basic-lto.macho.x86_64 |
RUN: llvm-dwarfdump -a %t.dSYM/Contents/Resources/DWARF/basic-lto-dw4.macho.x86_64 | FileCheck %S/basic-lto-dw4-linking-x86.test

# Multiple inputs in a named bundle in flat mode... impossible.
RUN: not dsymutil -f -oso-prepend-path=%p/.. %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64 -o %t.dSYM 2>&1 | FileCheck %s
RUN: not dsymutil --linker llvm -f -oso-prepend-path=%p/.. \
RUN: %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 \
RUN: %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64 \
RUN: -o %t.dSYM 2>&1 | FileCheck %s

CHECK: error: cannot use -o with multiple inputs in flat mode
10 changes: 10 additions & 0 deletions llvm/test/tools/llvm-dwarfutil/ELF/X86/accelerator-dwarf4.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
# RUN: llvm-dwarfutil --garbage-collection --build-accelerator=DWARF %t.o %t1
# RUN: llvm-dwarfdump --verify %t1 | FileCheck %s --check-prefix=VERIFY
# RUN: llvm-dwarfdump -a %t1 | FileCheck %s
#
# RUN: llvm-dwarfutil --linker llvm --no-garbage-collection \
# RUN: --build-accelerator=DWARF %t.o %t1
# RUN: llvm-dwarfdump --verify %t1 | FileCheck %s --check-prefix=VERIFY
# RUN: llvm-dwarfdump -a %t1 | FileCheck %s

# RUN: llvm-dwarfutil --linker llvm --garbage-collection \
# RUN: --build-accelerator=DWARF %t.o %t1
# RUN: llvm-dwarfdump --verify %t1 | FileCheck %s --check-prefix=VERIFY
# RUN: llvm-dwarfdump -a %t1 | FileCheck %s

# VERIFY: No errors

Expand Down
10 changes: 10 additions & 0 deletions llvm/test/tools/llvm-dwarfutil/ELF/X86/accelerator-dwarf5.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
# RUN: llvm-dwarfutil --garbage-collection --build-accelerator=DWARF %p/Inputs/dwarf5.out %t1
# RUN: llvm-dwarfdump --verify %t1 | FileCheck %s --check-prefix=VERIFY
# RUN: llvm-dwarfdump -a %t1 | FileCheck %s
#
# RUN: llvm-dwarfutil --linker llvm --no-garbage-collection \
# RUN: --build-accelerator=DWARF %p/Inputs/dwarf5.out %t1
# RUN: llvm-dwarfdump --verify %t1 | FileCheck %s --check-prefix=VERIFY
# RUN: llvm-dwarfdump -a %t1 | FileCheck %s

# RUN: llvm-dwarfutil --linker llvm --garbage-collection \
# RUN: --build-accelerator=DWARF %p/Inputs/dwarf5.out %t1
# RUN: llvm-dwarfdump --verify %t1 | FileCheck %s --check-prefix=VERIFY
# RUN: llvm-dwarfdump -a %t1 | FileCheck %s

# VERIFY: No errors

Expand Down