Skip to content

Commit b03f439

Browse files
committed
[mlir] Fix test failure with invalid piping syntax on old bash
Using '|&' syntax for piping both stdout and stderr is not supported by older bash. macOS pre-installs 3.2.57 as of today, and it causes test failure due to unexpected token '&'. We can use '2>&1' instead to make it compatible as much as possible. ``` ******************** TEST 'MLIR :: mlir-cpu-runner/invalid.mlir' FAILED ******************** Script: -- : 'RUN: at line 1'; not mlir-cpu-runner --no-implicit-module llvm-project/mlir/test/mlir-cpu-runner/invalid.mlir |& llvm-project/build/bin/FileCheck llvm-project/mlir/test/mlir-cpu-runner/invalid.mlir -- Exit Code: 2 Command Output (stderr): -- mlir-cpu-runner/Output/invalid.mlir.script: line 1: syntax error near unexpected token `&' /mlir-cpu-runner/Output/invalid.mlir.script: line 1: `set -o pipefail;{ : 'RUN: at line 1'; not mlir-cpu-runner --no-implicit-module llvm-project/mlir/test/mlir-cpu-runner/invalid.mlir |& llvm-project/build/bin/FileCheck llvm-project/mlir/test/mlir-cpu-runner/invalid.mlir; }' ``` Reference: https://stackoverflow.com/questions/35384999/what-does-mean-in-bash Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D135347
1 parent b924c8c commit b03f439

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: not mlir-cpu-runner --no-implicit-module %s |& FileCheck %s
1+
// RUN: not mlir-cpu-runner --no-implicit-module %s 2>&1 | FileCheck %s
22

33
// CHECK: Error: top-level op must be a symbol table.
44
llvm.func @main()

mlir/test/mlir-reduce/invalid.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// UNSUPPORTED: system-windows
2-
// RUN: not mlir-reduce -opt-reduction-pass --no-implicit-module %s |& FileCheck %s --check-prefix=CHECK-PASS
3-
// RUN: not mlir-reduce -reduction-tree --no-implicit-module %s |& FileCheck %s --check-prefix=CHECK-TREE
2+
// RUN: not mlir-reduce -opt-reduction-pass --no-implicit-module %s 2>&1 | FileCheck %s --check-prefix=CHECK-PASS
3+
// RUN: not mlir-reduce -reduction-tree --no-implicit-module %s 2>&1 | FileCheck %s --check-prefix=CHECK-TREE
44

55
// The reduction passes are currently restricted to 'builtin.module'.
66
// CHECK-PASS: error: Can't add pass '{{.+}}' restricted to 'builtin.module' on a PassManager intended to run on 'func.func'

0 commit comments

Comments
 (0)