Skip to content

Commit 887f700

Browse files
authored
[NFC][bolt][test] Change '|&' to '2>&1 |' for lit internal shell support (#102402)
This patches changes all references to '|&' in bolt tests to instead use the '2>&1 |' syntax for better consistency across testing and so that lit's internal shell can be used to run these tests. This addresses a suggestion made in the comments of this RFC: https://discourse.llvm.org/t/rfc-enabling-the-lit-internal-shell-by-default/80179. Fixes #102388
1 parent bfbd4cc commit 887f700

16 files changed

+26
-26
lines changed

bolt/test/X86/encoding-validation.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o
44
# RUN: ld.lld %t.o -o %t.exe -q
5-
# RUN: llvm-bolt %t.exe --relocs -o %t.out --check-encoding |& FileCheck %s
5+
# RUN: llvm-bolt %t.exe --relocs -o %t.out --check-encoding 2>&1 | FileCheck %s
66

77
.text
88
.globl _start

bolt/test/X86/gotpcrelx.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
# RUN: ld.lld %t.o -o %t.pie.exe -q -pie
1111
# RUN: ld.lld %t.o -o %t.no-relax.exe -q --no-relax
1212
# RUN: llvm-bolt %t.exe --relocs -o %t.out --print-cfg --print-only=_start \
13-
# RUN: |& FileCheck --check-prefix=BOLT %s
13+
# RUN: 2>&1 | FileCheck --check-prefix=BOLT %s
1414
# RUN: llvm-bolt %t.pie.exe -o %t.null --print-cfg --print-only=_start \
15-
# RUN: |& FileCheck --check-prefix=PIE-BOLT %s
15+
# RUN: 2>&1 | FileCheck --check-prefix=PIE-BOLT %s
1616
# RUN: llvm-bolt %t.no-relax.exe -o %t.null --print-cfg --print-only=_start \
17-
# RUN: |& FileCheck --check-prefix=NO-RELAX-BOLT %s
17+
# RUN: 2>&1 | FileCheck --check-prefix=NO-RELAX-BOLT %s
1818
# RUN: llvm-objdump -d --no-show-raw-insn --print-imm-hex \
1919
# RUN: %t.out | FileCheck --check-prefix=DISASM %s
2020

bolt/test/X86/icf-jump-tables.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# REQUIRES: system-linux
55

66
# RUN: %clang %cflags -O1 -g %p/../Inputs/icf-jump-tables.c -o %t.exe -Wl,-q
7-
# RUN: llvm-bolt %t.exe --icf -o %t.bolt |& FileCheck %s
7+
# RUN: llvm-bolt %t.exe --icf -o %t.bolt 2>&1 | FileCheck %s
88

99
## Check that BOLT successfully folded a function with jump table:
1010
# CHECK: ICF folded {{.*}}. {{[^0]}} functions had jump tables.

bolt/test/X86/indirect-goto-pie.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ REQUIRES: x86_64-linux
66

77
RUN: %clang %S/Inputs/indirect_goto.c -o %t -fpic -pie -Wl,-q
88
RUN: not llvm-bolt %t -o %t.bolt --relocs=1 --print-cfg --print-only=main \
9-
RUN: |& FileCheck %s
9+
RUN: 2>&1 | FileCheck %s
1010

1111
## Check that processing works if main() is skipped.
1212
RUN: llvm-bolt %t -o %t.bolt --relocs=1 --skip-funcs=main

bolt/test/X86/jump-table-func-entry.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# RUN: %clang %cflags %t.o -o %t.exe -no-pie -Wl,-q
88

99
# RUN: llvm-bolt %t.exe --print-normalized --print-only=foo -o %t.out \
10-
# RUN: |& FileCheck %s
10+
# RUN: 2>&1 | FileCheck %s
1111

1212

1313

bolt/test/X86/keep-nops.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o
66
# RUN: ld.lld %t.o -o %t.exe -q
77
# RUN: llvm-bolt %t.exe -o %t.bolt.exe --keep-nops --relocs --print-finalized \
8-
# RUN: |& FileCheck --check-prefix=CHECK-BOLT %s
8+
# RUN: 2>&1 | FileCheck --check-prefix=CHECK-BOLT %s
99
# RUN: llvm-objdump -d %t.bolt.exe | FileCheck %s
1010

1111
.text

bolt/test/X86/linux-bug-table.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
## Verify bug entry bindings again after unreachable code elimination.
1616

1717
# RUN: llvm-bolt %t.out -o %t.out.1 --print-only=_start --print-normalized \
18-
# RUN: |& FileCheck --check-prefix=CHECK-REOPT %s
18+
# RUN: 2>&1 | FileCheck --check-prefix=CHECK-REOPT %s
1919

2020
# CHECK: BOLT-INFO: Linux kernel binary detected
2121
# CHECK: BOLT-INFO: parsed 2 bug table entries

bolt/test/X86/linux-orc.s

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
## Verify reading contents of ORC sections.
1111

12-
# RUN: llvm-bolt %t.exe --dump-orc -o /dev/null |& FileCheck %s \
12+
# RUN: llvm-bolt %t.exe --dump-orc -o /dev/null 2>&1 | FileCheck %s \
1313
# RUN: --check-prefix=CHECK-ORC
1414

1515
# CHECK-ORC: BOLT-INFO: ORC unwind information:
@@ -27,19 +27,19 @@
2727
## Verify ORC bindings to instructions.
2828

2929
# RUN: llvm-bolt %t.exe --print-normalized --dump-orc --print-orc -o %t.out \
30-
# RUN: --keep-nops=0 --bolt-info=0 |& FileCheck %s
30+
# RUN: --keep-nops=0 --bolt-info=0 2>&1 | FileCheck %s
3131

3232

3333
## Verify ORC bindings after rewrite.
3434

3535
# RUN: llvm-bolt %t.out -o %t.out.1 --print-normalized --print-orc \
36-
# RUN: |& FileCheck %s
36+
# RUN: 2>&1 | FileCheck %s
3737

3838
## Verify ORC binding after rewrite when some of the functions are skipped.
3939

4040
# RUN: llvm-bolt %t.exe -o %t.out --skip-funcs=bar --bolt-info=0 --keep-nops=0
4141
# RUN: llvm-bolt %t.out -o %t.out.1 --print-normalized --print-orc \
42-
# RUN: |& FileCheck %s
42+
# RUN: 2>&1 | FileCheck %s
4343

4444
# CHECK: BOLT-INFO: Linux kernel binary detected
4545
# CHECK: BOLT-INFO: parsed 9 ORC entries

bolt/test/X86/linux-pci-fixup.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
44
# RUN: %clang %cflags -nostdlib %t.o -o %t.exe \
55
# RUN: -Wl,--image-base=0xffffffff80000000,--no-dynamic-linker,--no-eh-frame-hdr,--no-pie
6-
# RUN: llvm-bolt %t.exe --print-normalized -o %t.out |& FileCheck %s
6+
# RUN: llvm-bolt %t.exe --print-normalized -o %t.out 2>&1 | FileCheck %s
77

88
## Check that BOLT correctly parses the Linux kernel .pci_fixup section and
99
## verify that PCI fixup hook in the middle of a function is detected.

bolt/test/X86/linux-smp-locks.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
# RUN: %clang %cflags -nostdlib %t.o -o %t.exe \
88
# RUN: -Wl,--image-base=0xffffffff80000000,--no-dynamic-linker,--no-eh-frame-hdr,--no-pie
99
# RUN: llvm-bolt %t.exe --print-normalized --keep-nops=0 --bolt-info=0 -o %t.out \
10-
# RUN: |& FileCheck %s
10+
# RUN: 2>&1 | FileCheck %s
1111

1212
## Check the output of BOLT with NOPs removed.
1313

14-
# RUN: llvm-bolt %t.out -o %t.out.1 --print-normalized |& FileCheck %s
14+
# RUN: llvm-bolt %t.out -o %t.out.1 --print-normalized 2>&1 | FileCheck %s
1515

1616
# CHECK: BOLT-INFO: Linux kernel binary detected
1717
# CHECK: BOLT-INFO: parsed 2 SMP lock entries

bolt/test/X86/linux-static-calls.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
## Verify static calls bindings to instructions.
1010

1111
# RUN: llvm-bolt %t.exe --print-normalized -o %t.out --keep-nops=0 \
12-
# RUN: --bolt-info=0 |& FileCheck %s
12+
# RUN: --bolt-info=0 2>&1 | FileCheck %s
1313

1414
## Verify the bindings again on the rewritten binary with nops removed.
1515

16-
# RUN: llvm-bolt %t.out -o %t.out.1 --print-normalized |& FileCheck %s
16+
# RUN: llvm-bolt %t.out -o %t.out.1 --print-normalized 2>&1 | FileCheck %s
1717

1818
# CHECK: BOLT-INFO: Linux kernel binary detected
1919
# CHECK: BOLT-INFO: parsed 2 static call entries

bolt/test/X86/linux-static-keys.s

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
## Verify static keys jump bindings to instructions.
1212

1313
# RUN: llvm-bolt %t.exe --print-normalized -o %t.out --keep-nops=0 \
14-
# RUN: --bolt-info=0 |& FileCheck %s
14+
# RUN: --bolt-info=0 2>&1 | FileCheck %s
1515

1616
## Verify that profile is matched correctly.
1717

1818
# RUN: llvm-bolt %t.exe --print-normalized -o %t.out --keep-nops=0 \
19-
# RUN: --bolt-info=0 --data %t.fdata |& \
20-
# RUN: FileCheck --check-prefix=CHECK-FDATA %s
19+
# RUN: --bolt-info=0 --data %t.fdata 2>&1 \
20+
# RUN: | FileCheck --check-prefix=CHECK-FDATA %s
2121

2222
## Verify the bindings again on the rewritten binary with nops removed.
2323

24-
# RUN: llvm-bolt %t.out -o %t.out.1 --print-normalized |& FileCheck %s
24+
# RUN: llvm-bolt %t.out -o %t.out.1 --print-normalized 2>&1 | FileCheck %s
2525

2626
# CHECK: BOLT-INFO: Linux kernel binary detected
2727
# CHECK: BOLT-INFO: parsed 2 static keys jump entries

bolt/test/X86/pt_gnu_relro.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# READELF: 04 .got
2323

2424
# RUN: llvm-bolt %t.exe --relocs -o %t.null -v=1 \
25-
# RUN: |& FileCheck --check-prefix=BOLT %s
25+
# RUN: 2>&1 | FileCheck --check-prefix=BOLT %s
2626
# BOLT: BOLT-INFO: marking .got as GNU_RELRO
2727

2828
.globl _start

bolt/test/X86/unclaimed-jt-entries.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
2020
# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
21-
# RUN: llvm-bolt %t.exe -v=1 -o %t.out |& FileCheck %s
21+
# RUN: llvm-bolt %t.exe -v=1 -o %t.out 2>&1 | FileCheck %s
2222

2323
# CHECK: BOLT-WARNING: unclaimed data to code reference (possibly an unrecognized jump table entry) to .Ltmp[[#]] in main
2424
# CHECK: BOLT-WARNING: unclaimed data to code reference (possibly an unrecognized jump table entry) to .Ltmp[[#]] in main

bolt/test/X86/vararg.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
REQUIRES: x86_64-linux
66

77
RUN: %clangxx %cxxflags -no-pie %p/../Inputs/vararg.s -o %t -Wl,-q
8-
RUN: llvm-bolt %t -o %t.null --print-cfg --print-only=.*printf.* |& FileCheck %s
8+
RUN: llvm-bolt %t -o %t.null --print-cfg --print-only=.*printf.* 2>&1 | FileCheck %s
99

1010
CHECK: IsSimple : 0
1111
CHECK: Entry Point

bolt/test/runtime/X86/unclaimed-jt-entries.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
2020
# RUN: %clang %cflags %S/Inputs/unclaimed-jt-entries.c -no-pie %t.o -o %t.exe -Wl,-q
21-
# RUN: llvm-bolt %t.exe -v=1 -o %t.out --sequential-disassembly |& FileCheck %s
21+
# RUN: llvm-bolt %t.exe -v=1 -o %t.out --sequential-disassembly 2>&1 | FileCheck %s
2222

2323
# CHECK: BOLT-WARNING: unclaimed data to code reference (possibly an unrecognized jump table entry) to .Ltmp[[#]] in func
2424
# CHECK: BOLT-WARNING: unclaimed data to code reference (possibly an unrecognized jump table entry) to .Ltmp[[#]] in func

0 commit comments

Comments
 (0)