Skip to content

Commit 988978f

Browse files
committed
[ELF,test] Add env LLD_IN_TEST=1 to make some tests work if RUN_LLD_MAIN_TWICE
1 parent f21c35d commit 988978f

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

lld/test/ELF/invalid/bad-reloc-target.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Symbols:
5151
## Relocation refers to a symbol with index larger than
5252
## symbol table size. Check we report it.
5353
# RUN: yaml2obj --docnum=3 %s -o %t2.o
54-
# RUN: not ld.lld %t2.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR3
54+
# RUN: env LLD_IN_TEST=1 not ld.lld %t2.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR3
5555
# ERR3: error: {{.*}}.o: invalid symbol index
5656

5757
--- !ELF

lld/test/ELF/lto/cache-warnings.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
; REQUIRES: x86, shell
2+
; UNSUPPORTED: main-run-twice
23

34
; RUN: opt -module-hash -module-summary %s -o %t.o
45
; RUN: opt -module-hash -module-summary %p/Inputs/cache.ll -o %t2.o

lld/test/ELF/lto/ltopasses-custom.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ define void @barrier() {
2424
; ATOMIC-NEXT: ret void
2525

2626
; Check that invalid passes are rejected gracefully.
27-
; RUN: not --crash ld.lld -m elf_x86_64 %t.o -o /dev/null \
27+
; RUN: env LLD_IN_TEST=1 not --crash ld.lld -m elf_x86_64 %t.o -o /dev/null \
2828
; RUN: --lto-newpm-passes=iamnotapass -shared 2>&1 | \
2929
; RUN: FileCheck %s --check-prefix=INVALID
3030
; INVALID: unable to parse pass pipeline description 'iamnotapass': unknown pass name 'iamnotapass'
3131

3232
; Check that invalid AA pipelines are rejected gracefully.
33-
; RUN: not --crash ld.lld -m elf_x86_64 %t.o -o /dev/null \
33+
; RUN: env LLD_IN_TEST=1 not --crash ld.lld -m elf_x86_64 %t.o -o /dev/null \
3434
; RUN: --lto-newpm-passes=globaldce --lto-aa-pipeline=patatino \
3535
; RUN: -shared 2>&1 | \
3636
; RUN: FileCheck %s --check-prefix=INVALIDAA

lld/test/ELF/lto/verify-invalid.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
; REQUIRES: x86
22
; RUN: llvm-as %s -o %t.o
3-
; RUN: ld.lld %t.o -o %t2 --lto-debug-pass-manager \
3+
; RUN: env LLD_IN_TEST=1 ld.lld %t.o -o %t2 --lto-debug-pass-manager \
44
; RUN: 2>&1 | FileCheck -check-prefix=DEFAULT-NPM %s
5-
; RUN: ld.lld %t.o -o %t2 --lto-debug-pass-manager \
5+
; RUN: env LLD_IN_TEST=1 ld.lld %t.o -o %t2 --lto-debug-pass-manager \
66
; RUN: -disable-verify 2>&1 | FileCheck -check-prefix=DISABLE-NPM %s
7-
; RUN: ld.lld %t.o -o %t2 --lto-debug-pass-manager \
7+
; RUN: env LLD_IN_TEST=1 ld.lld %t.o -o %t2 --lto-debug-pass-manager \
88
; RUN: --plugin-opt=disable-verify 2>&1 | FileCheck -check-prefix=DISABLE-NPM %s
99

1010
target triple = "x86_64-unknown-linux-gnu"

0 commit comments

Comments
 (0)