Skip to content

Commit 55ec637

Browse files
[lld] Update tests redirecting multiple commands to FileCheck
This patch updates two LLD tests that were redirecting multiple commands to the same FileCheck invocation to not use this strategy. This construction is not supported by lit's internal shell and given its rarirty, it does not make sense to add support. The workaround is to dump the contents of multiple commands into a file and then run FileCheck on that. Towards llvm#102700. Reviewers: petrhosek, mysterymath, cmtice, ilovepi, carlocab, MaskRay Reviewed By: carlocab, cmtice Pull Request: llvm#156526
1 parent c9ca354 commit 55ec637

File tree

2 files changed

+60
-43
lines changed

2 files changed

+60
-43
lines changed

lld/test/ELF/lto/comdat-nodeduplicate.ll

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; REQUIRES: x86, shell
1+
; REQUIRES: x86
22

33
;; Keep __profd_foo in a nodeduplicate comdat, despite a comdat of the same name
44
;; in a previous object file.
@@ -36,19 +36,25 @@
3636

3737
; RUN: ld.lld --thinlto-index-only --save-temps -u foo %t/a.bc %t/b.bc -o %t/ab
3838
; RUN: FileCheck %s --check-prefix=RESOL_AB < %t/ab.resolution.txt
39-
; RUN: (llvm-dis < %t/b.bc && llvm-dis < %t/b.bc.thinlto.bc) | FileCheck %s --check-prefix=IR_AB
39+
; RUN: llvm-dis < %t/b.bc > %t.out
40+
; RUN: llvm-dis < %t/b.bc.thinlto.bc >> %t.out
41+
; RUN: FileCheck %s --check-prefix=IR_AB --input-file %t.out
4042
; RUN: ld.lld -u foo %t/a.bc %t/b.bc -o %t/ab
4143
; RUN: llvm-readelf -x .data %t/ab | FileCheck %s --check-prefix=DATA
4244

4345
; RUN: ld.lld --thinlto-index-only --save-temps -u foo %t/a.bc --start-lib %t/b.bc --end-lib -o %t/ab
4446
; RUN: FileCheck %s --check-prefix=RESOL_AB < %t/ab.resolution.txt
45-
; RUN: (llvm-dis < %t/b.bc && llvm-dis < %t/b.bc.thinlto.bc) | FileCheck %s --check-prefix=IR_AB
47+
; RUN: llvm-dis < %t/b.bc > %t.out
48+
; RUN: llvm-dis < %t/b.bc.thinlto.bc >> %t.out
49+
; RUN: FileCheck %s --check-prefix=IR_AB --input-file %t.out
4650
; RUN: ld.lld -u foo %t/a.bc --start-lib %t/b.bc --end-lib -o %t/ab
4751
; RUN: llvm-readelf -x .data %t/ab | FileCheck %s --check-prefix=DATA
4852

4953
; RUN: ld.lld --thinlto-index-only --save-temps -u foo -u c %t/a.bc --start-lib %t/b.bc %t/c.bc --end-lib -o %t/abc
5054
; RUN: FileCheck %s --check-prefix=RESOL_ABC < %t/abc.resolution.txt
51-
; RUN: (llvm-dis < %t/b.bc && llvm-dis < %t/b.bc.thinlto.bc) | FileCheck %s --check-prefix=IR_ABC
55+
; RUN: llvm-dis < %t/b.bc > %t.out
56+
; RUN: llvm-dis < %t/b.bc.thinlto.bc >> %t.out
57+
; RUN: FileCheck %s --check-prefix=IR_ABC --input-file %t.out
5258
; RUN: ld.lld -u foo %t/a.bc --start-lib %t/b.bc %t/c.bc --end-lib -o %t/abc
5359
; RUN: llvm-readelf -x .data %t/abc | FileCheck %s --check-prefix=DATA
5460

lld/test/MachO/stabs.s

Lines changed: 50 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# REQUIRES: x86, shell
1+
# REQUIRES: x86
22
# UNSUPPORTED: system-windows
33
# RUN: rm -rf %t; split-file %s %t
44
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o
@@ -9,71 +9,79 @@
99
# RUN: env TZ=GMT touch -t "197001010000.32" %t/foo.o
1010
# RUN: llvm-ar rcsU %t/foo.a %t/foo.o
1111

12-
# RUN: ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.o %t/no-debug.o -o %t/test
13-
# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
14-
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
15-
# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20
12+
# RUN: env ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.o %t/no-debug.o -o %t/test
13+
# RUN: llvm-objdump --section-headers %t/test > %t.out
14+
# RUN: dsymutil -s %t/test >> %t.out
15+
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
16+
# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --input-file %t.out
1617

1718
## Check that we emit the right modtime even when the object file is in an
1819
## archive.
19-
# RUN: ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.a %t/no-debug.o -o %t/test
20-
# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
21-
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
22-
# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20
20+
# RUN: env ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.a %t/no-debug.o -o %t/test
21+
# RUN: llvm-objdump --section-headers %t/test > %t.out
22+
# RUN: dsymutil -s %t/test >> %t.out
23+
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
24+
# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --input-file %t.out
2325

2426
## Check that we don't emit modtimes if ZERO_AR_DATE is set.
2527
# RUN: env ZERO_AR_DATE=1 %lld -lSystem %t/test.o %t/foo.o %t/no-debug.o \
2628
# RUN: -o %t/test
27-
# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
28-
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
29-
# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0
29+
# RUN: llvm-objdump --section-headers %t/test > %t.out
30+
# RUN: dsymutil -s %t/test >> %t.out
31+
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
32+
# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out
3033
# RUN: env %lld -lSystem %t/test.o %t/foo.a %t/no-debug.o \
3134
# RUN: -o %t/test
32-
# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
33-
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
34-
# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0
35+
# RUN: llvm-objdump --section-headers %t/test > %t.out
36+
# RUN: dsymutil -s %t/test >> %t.out
37+
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
38+
# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out
3539
# RUN: env %lld -lSystem %t/test.o %t/no-debug.o \
3640
# RUN: -all_load %t/foo.a -o %t/test
37-
# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
38-
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
39-
# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0
41+
# RUN: llvm-objdump --section-headers %t/test > %t.out
42+
# RUN: dsymutil -s %t/test >> %t.out
43+
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
44+
# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out
4045
# RUN: env %lld -lSystem %t/test.o %t/no-debug.o \
4146
# RUN: -force_load %t/foo.a -o %t/test
42-
# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
43-
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
44-
# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0
47+
# RUN: llvm-objdump --section-headers %t/test > %t.out
48+
# RUN: dsymutil -s %t/test >> %t.out
49+
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
50+
# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out
4551
# RUN: env ZERO_AR_DATE=0 %lld -lSystem -reproducible %t/test.o %t/foo.o \
4652
# RUN: %t/no-debug.o -o %t/test
47-
# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
48-
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
49-
# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0
53+
# RUN: llvm-objdump --section-headers %t/test > %t.out
54+
# RUN: dsymutil -s %t/test >> %t.out
55+
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
56+
# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out
5057

5158
## Check that we emit absolute paths to the object files in our OSO entries
5259
## even if our inputs are relative paths.
53-
# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -o test
54-
# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
55-
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
56-
# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20
60+
# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -o test
61+
# RUN: llvm-objdump --section-headers %t/test > %t.out
62+
# RUN: dsymutil -s %t/test >> %t.out
63+
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
64+
# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --input-file %t.out
5765

5866
## Check that we emit relative path to object files in OSO entries
5967
## when -oso_prefix <path> is used.
60-
# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t" -o %t/test-rel
68+
# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t" -o %t/test-rel
6169
# RUN: dsymutil -s %t/test-rel | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-PATH
62-
# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t/" -o %t/test-rel
70+
# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t/" -o %t/test-rel
6371
# RUN: dsymutil -s %t/test-rel | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-PATH-NO-SLASH
64-
# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o %t/test-rel-dot
72+
# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o %t/test-rel-dot
6573
# RUN: dsymutil -s %t/test-rel-dot | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT
66-
# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem ./test.o ./foo.o ./no-debug.o -oso_prefix "." -o %t/test-rel-dot
74+
# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem ./test.o ./foo.o ./no-debug.o -oso_prefix "." -o %t/test-rel-dot
6775
# RUN: dsymutil -s %t/test-rel-dot | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT-EXPLICIT
6876

6977
## Check that symlinks are not expanded when -oso_prefix . is used.
7078
# RUN: mkdir -p %t/private/var/folders/tmp && ln -s private/var %t/var
7179
# RUN: cp %t/test.o %t/foo.o %t/no-debug.o %t/private/var/folders/tmp
7280
# RUN: env TZ=GMT touch -t "197001010000.16" %t/private/var/folders/tmp/test.o
7381
# RUN: env TZ=GMT touch -t "197001010000.32" %t/private/var/folders/tmp/foo.o
74-
# RUN: cd %t/var/folders/tmp && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o test-rel-symlink
82+
# RUN: cd %t/var/folders/tmp && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o test-rel-symlink
7583
# RUN: dsymutil -s %t/private/var/folders/tmp/test-rel-symlink | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT
76-
# RUN: cd %t/var/folders/tmp && ZERO_AR_DATE=0 %lld -lSystem ./test.o ./foo.o ./no-debug.o -oso_prefix "." -o test-rel-symlink
84+
# RUN: cd %t/var/folders/tmp && env ZERO_AR_DATE=0 %lld -lSystem ./test.o ./foo.o ./no-debug.o -oso_prefix "." -o test-rel-symlink
7785
# RUN: dsymutil -s %t/private/var/folders/tmp/test-rel-symlink | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT-EXPLICIT
7886

7987
## Check that we don't emit DWARF or stabs when -S is used
@@ -82,10 +90,11 @@
8290
## expect to not find any entries which requires the exit code to be negated.
8391
# RUN: llvm-nm -ap %t/test-no-debug | not grep -e ' - '
8492

85-
# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.a no-debug.o -o %t/test
86-
# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
87-
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
88-
# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20
93+
# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.a no-debug.o -o %t/test
94+
# RUN: llvm-objdump --section-headers %t/test > %t.out
95+
# RUN: dsymutil -s %t/test >> %t.out
96+
# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
97+
# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --input-file %t.out
8998

9099
# CHECK: Sections:
91100
# CHECK-NEXT: Idx Name
@@ -159,7 +168,9 @@
159168
## when forming N_SO.
160169
# RUN: llvm-mc -filetype obj -triple=x86_64-apple-darwin %t/abs-path.s -o %t/abs-path.o
161170
# RUN: %lld %t/abs-path.o -o %t/test
162-
# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | FileCheck %s --check-prefix=ABS-PATH
171+
# RUN: llvm-objdump --section-headers %t/test > %t.out
172+
# RUN: dsymutil -s %t/test >> %t.out
173+
# RUN: FileCheck %s --check-prefix=ABS-PATH --input-file %t.out
163174
# ABS-PATH: (N_SO ) 00 0000 0000000000000000 '/foo.cpp'
164175

165176
#--- test.s

0 commit comments

Comments
 (0)