From eafc64ed6325eba962096d4a947d7e45e909bfde Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 23 Dec 2021 11:25:13 -0800 Subject: [PATCH] [Driver][test] Remove unneeded -no-canonical-prefixes and use preferred --target= -no-canonical-prefixes is not needed if we omit "clang" from CHECK lines. "-cc1" is sufficient to anchor the line we want to test. --target= is preferred over Separate form -target. --- clang/test/Driver/spirv-toolchain.cl | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/clang/test/Driver/spirv-toolchain.cl b/clang/test/Driver/spirv-toolchain.cl index d2562c0b667d..4be08f127290 100644 --- a/clang/test/Driver/spirv-toolchain.cl +++ b/clang/test/Driver/spirv-toolchain.cl @@ -1,58 +1,58 @@ // Check object emission. -// RUN: %clang -### -no-canonical-prefixes -target spirv64 -x cl -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s -// RUN: %clang -### -target spirv64 %s 2>&1 | FileCheck --check-prefix=SPV64 %s -// RUN: %clang -### -no-canonical-prefixes -target spirv64 -x ir -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s -// RUN: %clang -### -no-canonical-prefixes -target spirv64 -x clcpp -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s -// RUN: %clang -### -no-canonical-prefixes -target spirv64 -x c -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s +// RUN: %clang -### --target=spirv64 -x cl -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s +// RUN: %clang -### --target=spirv64 %s 2>&1 | FileCheck --check-prefix=SPV64 %s +// RUN: %clang -### --target=spirv64 -x ir -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s +// RUN: %clang -### --target=spirv64 -x clcpp -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s +// RUN: %clang -### --target=spirv64 -x c -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s -// SPV64: clang{{.*}} "-cc1" "-triple" "spirv64" +// SPV64: "-cc1" "-triple" "spirv64" // SPV64-SAME: "-o" [[BC:".*bc"]] // SPV64: {{llvm-spirv.*"}} [[BC]] "-o" {{".*o"}} -// RUN: %clang -### -no-canonical-prefixes -target spirv32 -x cl -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s -// RUN: %clang -### -target spirv32 %s 2>&1 | FileCheck --check-prefix=SPV32 %s -// RUN: %clang -### -no-canonical-prefixes -target spirv32 -x ir -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s -// RUN: %clang -### -no-canonical-prefixes -target spirv32 -x clcpp -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s -// RUN: %clang -### -no-canonical-prefixes -target spirv32 -x c -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s +// RUN: %clang -### --target=spirv32 -x cl -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s +// RUN: %clang -### --target=spirv32 %s 2>&1 | FileCheck --check-prefix=SPV32 %s +// RUN: %clang -### --target=spirv32 -x ir -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s +// RUN: %clang -### --target=spirv32 -x clcpp -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s +// RUN: %clang -### --target=spirv32 -x c -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s -// SPV32: clang{{.*}} "-cc1" "-triple" "spirv32" +// SPV32: "-cc1" "-triple" "spirv32" // SPV32-SAME: "-o" [[BC:".*bc"]] // SPV32: {{llvm-spirv.*"}} [[BC]] "-o" {{".*o"}} //----------------------------------------------------------------------------- // Check Assembly emission. -// RUN: %clang -### -no-canonical-prefixes -target spirv64 -x cl -S %s 2>&1 | FileCheck --check-prefix=SPT64 %s -// RUN: %clang -### -no-canonical-prefixes -target spirv64 -x ir -S %s 2>&1 | FileCheck --check-prefix=SPT64 %s -// RUN: %clang -### -no-canonical-prefixes -target spirv64 -x clcpp -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s -// RUN: %clang -### -no-canonical-prefixes -target spirv64 -x c -S %s 2>&1 | FileCheck --check-prefix=SPT64 %s +// RUN: %clang -### --target=spirv64 -x cl -S %s 2>&1 | FileCheck --check-prefix=SPT64 %s +// RUN: %clang -### --target=spirv64 -x ir -S %s 2>&1 | FileCheck --check-prefix=SPT64 %s +// RUN: %clang -### --target=spirv64 -x clcpp -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s +// RUN: %clang -### --target=spirv64 -x c -S %s 2>&1 | FileCheck --check-prefix=SPT64 %s -// SPT64: clang{{.*}} "-cc1" "-triple" "spirv64" +// SPT64: "-cc1" "-triple" "spirv64" // SPT64-SAME: "-o" [[BC:".*bc"]] // SPT64: {{llvm-spirv.*"}} [[BC]] "--spirv-tools-dis" "-o" {{".*s"}} -// RUN: %clang -### -no-canonical-prefixes -target spirv32 -x cl -S %s 2>&1 | FileCheck --check-prefix=SPT32 %s -// RUN: %clang -### -no-canonical-prefixes -target spirv32 -x ir -S %s 2>&1 | FileCheck --check-prefix=SPT32 %s -// RUN: %clang -### -no-canonical-prefixes -target spirv32 -x clcpp -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s -// RUN: %clang -### -no-canonical-prefixes -target spirv32 -x c -S %s 2>&1 | FileCheck --check-prefix=SPT32 %s +// RUN: %clang -### --target=spirv32 -x cl -S %s 2>&1 | FileCheck --check-prefix=SPT32 %s +// RUN: %clang -### --target=spirv32 -x ir -S %s 2>&1 | FileCheck --check-prefix=SPT32 %s +// RUN: %clang -### --target=spirv32 -x clcpp -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s +// RUN: %clang -### --target=spirv32 -x c -S %s 2>&1 | FileCheck --check-prefix=SPT32 %s -// SPT32: clang{{.*}} "-cc1" "-triple" "spirv32" +// SPT32: "-cc1" "-triple" "spirv32" // SPT32-SAME: "-o" [[BC:".*bc"]] // SPT32: {{llvm-spirv.*"}} [[BC]] "--spirv-tools-dis" "-o" {{".*s"}} //----------------------------------------------------------------------------- // Check assembly input -> object output -// RUN: %clang -### -no-canonical-prefixes -target spirv64 -x assembler -c %s 2>&1 | FileCheck --check-prefix=ASM %s -// RUN: %clang -### -no-canonical-prefixes -target spirv32 -x assembler -c %s 2>&1 | FileCheck --check-prefix=ASM %s +// RUN: %clang -### --target=spirv64 -x assembler -c %s 2>&1 | FileCheck --check-prefix=ASM %s +// RUN: %clang -### --target=spirv32 -x assembler -c %s 2>&1 | FileCheck --check-prefix=ASM %s // ASM: {{llvm-spirv.*"}} {{".*"}} "-to-binary" "-o" {{".*o"}} //----------------------------------------------------------------------------- // Check --save-temps. -// RUN: %clang -### -no-canonical-prefixes -target spirv64 -x cl -c %s --save-temps 2>&1 | FileCheck --check-prefix=TMP %s +// RUN: %clang -### --target=spirv64 -x cl -c %s --save-temps 2>&1 | FileCheck --check-prefix=TMP %s -// TMP: clang{{.*}} "-cc1" "-triple" "spirv64" +// TMP: "-cc1" "-triple" "spirv64" // TMP-SAME: "-E" // TMP-SAME: "-o" [[I:".*i"]] -// TMP: clang{{.*}} "-cc1" "-triple" "spirv64" +// TMP: "-cc1" "-triple" "spirv64" // TMP-SAME: "-o" [[BC:".*bc"]] // TMP-SAME: [[I]] // TMP: {{llvm-spirv.*"}} [[BC]] "--spirv-tools-dis" "-o" [[S:".*s"]] @@ -60,6 +60,6 @@ //----------------------------------------------------------------------------- // Check that warning occurs if multiple input files are passed. -// RUN: %clang -### -target spirv64 %s %s 2>&1 | FileCheck --check-prefix=WARN %s +// RUN: %clang -### --target=spirv64 %s %s 2>&1 | FileCheck --check-prefix=WARN %s // WARN: warning: Linking multiple input files is not supported for SPIR-V yet