Skip to content

Commit 80765ed

Browse files
committed
[Driver][test] Ignore %clang exit code for -mcpu=native tests
They may be either 0 or 1, depending whether `--target=` specifies a native target.
1 parent 9155e51 commit 80765ed

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

clang/test/Driver/aarch64-mcpu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
// We cannot check much for -mcpu=native, but it should be replaced by either generic or a valid
2121
// Arm cpu string, depending on the host.
22-
// RUN: not %clang --target=arm64 -mcpu=native -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-NATIVE %s
22+
// RUN: %clang --target=arm64 -mcpu=native -### -c %s 2> %t.err || true
23+
// RUN: FileCheck --input-file=%t.err -check-prefix=ARM64-NATIVE %s
2324
// ARM64-NATIVE-NOT: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "native"
2425

2526
// RUN: %clang --target=arm64-apple-ios -arch arm64 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-IOS %s

clang/test/Driver/ppc-cpus.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// MCPU_PPC64: "-target-cpu" "ppc64"
33

44
/// We cannot check much for -mcpu=native, but it should be replaced by a CPU name.
5-
// RUN: %clang -### -c --target=powerpc64 %s -mcpu=native 2>&1 | FileCheck --check-prefix=MCPU_NATIVE %s
5+
// RUN: %clang -### -c --target=powerpc64 %s -mcpu=native 2> %t.err || true
6+
// RUN: FileCheck --input-file=%t.err -check-prefix=MCPU_NATIVE %s
67
// MCPU_NATIVE-NOT: "-target-cpu" "native"
78

89
/// Check that we are passing unknown mcpu options to the backend so an error

clang/test/Driver/riscv-cpus.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
// MCPU-SYNTACORE-SCR1-MAX: "-target-abi" "ilp32"
2222

2323
// We cannot check much for -mcpu=native, but it should be replaced by a valid CPU string.
24-
// RUN: not %clang --target=riscv64 -### -c %s 2>&1 -mcpu=native | FileCheck -check-prefix=MCPU-NATIVE %s
24+
// RUN: %clang --target=riscv64 -### -c %s -mcpu=native 2> %t.err || true
25+
// RUN: FileCheck --input-file=%t.err -check-prefix=MCPU-NATIVE %s
2526
// MCPU-NATIVE-NOT: "-target-cpu" "native"
2627

2728
// RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=rocket-rv32 | FileCheck -check-prefix=MTUNE-ROCKET32 %s

0 commit comments

Comments
 (0)