brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.9 KiB · 54c794c Raw
99 lines · plain
1// Check object emission.2// RUN: %clang -### --target=spirv64 -x cl -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s3// RUN: %clang -### --target=spirv64 %s 2>&1 | FileCheck --check-prefix=SPV64 %s4// RUN: %clang -### --target=spirv64 -x ir -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s5// RUN: %clang -### --target=spirv64 -x clcpp -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s6// RUN: %clang -### --target=spirv64 -x c -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s7 8// SPV64: "-cc1" "-triple" "spirv64"9// SPV64-SAME: "-o" {{".*o"}}10 11// RUN: %clang -### --target=spirv32 -x cl -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s12// RUN: %clang -### --target=spirv32 %s 2>&1 | FileCheck --check-prefix=SPV32 %s13// RUN: %clang -### --target=spirv32 -x ir -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s14// RUN: %clang -### --target=spirv32 -x clcpp -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s15// RUN: %clang -### --target=spirv32 -x c -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s16 17// SPV32: "-cc1" "-triple" "spirv32"18// SPV32-SAME: "-o" {{".*o"}}19 20//-----------------------------------------------------------------------------21// Check Assembly emission.22// RUN: %clang -### --target=spirv64 -x cl -S %s 2>&1 | FileCheck --check-prefix=SPT64 %s23// RUN: %clang -### --target=spirv64 -x ir -S %s 2>&1 | FileCheck --check-prefix=SPT64 %s24// RUN: %clang -### --target=spirv64 -x clcpp -c %s 2>&1 | FileCheck --check-prefix=SPV64 %s25// RUN: %clang -### --target=spirv64 -x c -S %s 2>&1 | FileCheck --check-prefix=SPT64 %s26 27// SPT64: "-cc1" "-triple" "spirv64"28// SPT64-SAME: "-o" {{".*s"}}29 30// RUN: %clang -### --target=spirv32 -x cl -S %s 2>&1 | FileCheck --check-prefix=SPT32 %s31// RUN: %clang -### --target=spirv32 -x ir -S %s 2>&1 | FileCheck --check-prefix=SPT32 %s32// RUN: %clang -### --target=spirv32 -x clcpp -c %s 2>&1 | FileCheck --check-prefix=SPV32 %s33// RUN: %clang -### --target=spirv32 -x c -S %s 2>&1 | FileCheck --check-prefix=SPT32 %s34 35// SPT32: "-cc1" "-triple" "spirv32"36// SPT32-SAME: "-o" {{".*s"}}37 38//-----------------------------------------------------------------------------39// Check assembly input -> object output40// RUN: %clang -### --target=spirv64 -x assembler -c %s 2>&1 | FileCheck --check-prefix=ASM %s41// RUN: %clang -### --target=spirv32 -x assembler -c %s 2>&1 | FileCheck --check-prefix=ASM %s42// ASM: {{spirv-as.*"}} {{".*"}} "-o" {{".*o"}}43 44//-----------------------------------------------------------------------------45// Check --save-temps.46// RUN: %clang -### --target=spirv64 -x cl -c %s --save-temps 2>&1 | FileCheck --check-prefix=TMP %s47 48// TMP: "-cc1" "-triple" "spirv64"49// TMP-SAME: "-E"50// TMP-SAME: "-o" [[I:".*i"]]51// TMP: "-cc1" "-triple" "spirv64"52// TMP-SAME: "-o" [[BC:".*bc"]]53// TMP-SAME: [[I]]54// TMP: "-cc1"55// TMP-SAME: "-o" [[S:".*s"]]56// TMP-SAME: [[BC]]57// TMP: {{spirv-as.*"}} [[S]] "-o" {{".*o"}}58 59//-----------------------------------------------------------------------------60// Check linking when multiple input files are passed.61// RUN: %clang -### -target spirv64 %s %s 2>&1 | FileCheck --check-prefix=SPLINK %s62 63// SPLINK: "-cc1" "-triple" "spirv64"64// SPLINK-SAME: "-o" [[SPV1:".*o"]]65// SPLINK: "-cc1" "-triple" "spirv64"66// SPLINK-SAME: "-o" [[SPV2:".*o"]]67// SPLINK: {{spirv-link.*"}} [[SPV1]] [[SPV2]] "-o" "a.out"68 69//-----------------------------------------------------------------------------70// Check bindings when linking when multiple input files are passed.71// RUN: %clang -### -target spirv64 -ccc-print-bindings %s %s 2>&1 | FileCheck --check-prefix=SPLINK-BINDINGS %s72 73// SPLINK-BINDINGS: "clang", inputs: [[[CL:".*cl"]]], output: [[OBJ1:".*o"]]74// SPLINK-BINDINGS: "clang", inputs: [[[CL]]], output: [[OBJ2:".*o"]]75// SPLINK-BINDINGS: "SPIR-V::Linker", inputs: [[[OBJ1]], [[OBJ2]]], output: "a.out"76 77//-----------------------------------------------------------------------------78// Check external vs internal object emission.79// RUN: %clang -### --target=spirv64 -fno-integrated-objemitter %s 2>&1 | FileCheck --check-prefix=XTOR %s80// RUN: %clang -### --target=spirv64 -fintegrated-objemitter %s 2>&1 | FileCheck --check-prefix=BACKEND %s81 82// XTOR-NOT: "llvm-spirv.*"83// BACKEND-NOT: "llvm-spirv.*"84 85//-----------------------------------------------------------------------------86// Check spirv-as-<LLVM_VERSION_MAJOR> is used if it is found in PATH.87//88// This test uses the PATH environment variable; on Windows, we may need to retain89// the original path for the built Clang binary to be able to execute (as it is90// used for locating dependent DLLs). Therefore, skip this test on system-windows.91//92// RUN: mkdir -p %t/versioned93// RUN: touch %t/versioned/spirv-as-%llvm-version-major \94// RUN:   && chmod +x %t/versioned/spirv-as-%llvm-version-major95// RUN: %if !system-windows && !system-cygwin %{ env "PATH=%t/versioned" %clang -### --target=spirv64 -x cl -c --save-temps %s 2>&1 \96// RUN:   | FileCheck -DVERSION=%llvm-version-major --check-prefix=VERSIONED %s %}97 98// VERSIONED: {{.*}}spirv-as-[[VERSION]]99