[clang] eafc64e - [Driver][test] Remove unneeded -no-canonical-prefixes and use preferred --target=

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 23 11:25:18 PST 2021


Author: Fangrui Song
Date: 2021-12-23T11:25:13-08:00
New Revision: eafc64ed6325eba962096d4a947d7e45e909bfde

URL: https://github.com/llvm/llvm-project/commit/eafc64ed6325eba962096d4a947d7e45e909bfde
DIFF: https://github.com/llvm/llvm-project/commit/eafc64ed6325eba962096d4a947d7e45e909bfde.diff

LOG: [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.

Added: 
    

Modified: 
    clang/test/Driver/spirv-toolchain.cl

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/spirv-toolchain.cl b/clang/test/Driver/spirv-toolchain.cl
index d2562c0b667d7..4be08f127290f 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


        


More information about the cfe-commits mailing list