[Driver][test] Ignore %clang exit code for -mcpu=native tests

They may be either 0 or 1, depending whether `--target=` specifies a
native target.
This commit is contained in:
Fangrui Song 2023-07-28 21:31:44 -07:00
parent 9155e517e6
commit 80765ede5b
3 changed files with 6 additions and 3 deletions

View File

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

View File

@ -2,7 +2,8 @@
// MCPU_PPC64: "-target-cpu" "ppc64"
/// We cannot check much for -mcpu=native, but it should be replaced by a CPU name.
// RUN: %clang -### -c --target=powerpc64 %s -mcpu=native 2>&1 | FileCheck --check-prefix=MCPU_NATIVE %s
// RUN: %clang -### -c --target=powerpc64 %s -mcpu=native 2> %t.err || true
// RUN: FileCheck --input-file=%t.err -check-prefix=MCPU_NATIVE %s
// MCPU_NATIVE-NOT: "-target-cpu" "native"
/// Check that we are passing unknown mcpu options to the backend so an error

View File

@ -21,7 +21,8 @@
// MCPU-SYNTACORE-SCR1-MAX: "-target-abi" "ilp32"
// We cannot check much for -mcpu=native, but it should be replaced by a valid CPU string.
// RUN: not %clang --target=riscv64 -### -c %s 2>&1 -mcpu=native | FileCheck -check-prefix=MCPU-NATIVE %s
// RUN: %clang --target=riscv64 -### -c %s -mcpu=native 2> %t.err || true
// RUN: FileCheck --input-file=%t.err -check-prefix=MCPU-NATIVE %s
// MCPU-NATIVE-NOT: "-target-cpu" "native"
// RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=rocket-rv32 | FileCheck -check-prefix=MTUNE-ROCKET32 %s