Debian Codegraph @

clang/test/Driver/hipspv-toolchain.hip

raw
1 // UNSUPPORTED: system-windows, system-cygwin
2
3 // RUN: %clang -### -target x86_64-linux-gnu --offload=spirv64 \
4 // RUN: --no-offload-new-driver --hip-path=%S/Inputs/hipspv -nohipwrapperinc %s \
5 // RUN: 2>&1 | FileCheck %s
6
7 // CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "spirv64"
8 // CHECK-SAME: "-aux-triple" "{{.*}}" "-emit-llvm-bc"
9 // CHECK-SAME: "-fcuda-is-device"
10 // CHECK-SAME: "-fcuda-allow-variadic-functions"
11 // CHECK-SAME: "-mlink-builtin-bitcode" {{".*/hipspv/lib/hip-device-lib/hipspv-spirv64.bc"}}
12 // CHECK-SAME: "-isystem" {{".*/hipspv/include"}}
13 // CHECK-SAME: "-fhip-new-launch-api"
14 // CHECK-SAME: "-o" [[DEV_BC:".*bc"]]
15 // CHECK-SAME: "-x" "hip"
16
17 // CHECK: {{".*llvm-link"}} "-o" [[LINK_BC:".*bc"]] [[DEV_BC]]
18
19 // CHECK: {{".*opt"}} [[LINK_BC]] "-load-pass-plugin"
20 // CHECK-SAME: {{".*/hipspv/lib/libLLVMHipSpvPasses.so"}}
21 // CHECK-SAME: "-passes=hip-post-link-passes" "-o" [[LOWER_BC:".*bc"]]
22
23 // CHECK: {{".*llvm-spirv"}} "--spirv-max-version=1.1" "--spirv-ext=+all"
24 // CHECK-SAME: [[LOWER_BC]] "-o" "[[SPIRV_OUT:.*out]]"
25
26 // CHECK: {{".*clang-offload-bundler"}} "-type=o" "-bundle-align=4096"
27 // CHECK-SAME: "-targets=host-x86_64-unknown-linux-gnu,hip-spirv64----generic"
28 // CHECK-SAME: "-input={{.*}}" "-input=[[SPIRV_OUT]]" "-output=[[BUNDLE:.*hipfb]]"
29
30 // CHECK: [[CLANG]] "-cc1" "-triple" {{".*"}} "-aux-triple" "spirv64"
31 // CHECK-SAME: "-emit-obj"
32 // CHECK-SAME: "-fcuda-include-gpubinary" "[[BUNDLE]]"
33 // CHECK-SAME: "-o" [[OBJ_HOST:".*o"]] "-x" "hip"
34
35 // CHECK: {{".*ld.*"}} {{.*}}[[OBJ_HOST]]
36
37 //-----------------------------------------------------------------------------
38 // Check llvm-spirv-<LLVM_VERSION_MAJOR> is used if it is found in PATH.
39 // RUN: mkdir -p %t/versioned
40 // RUN: touch %t/versioned/llvm-spirv-%llvm-version-major \
41 // RUN: && chmod +x %t/versioned/llvm-spirv-%llvm-version-major
42 // RUN: env "PATH=%t/versioned" %clang -### -target x86_64-linux-gnu \
43 // RUN: --offload=spirv64 --hip-path=%S/Inputs/hipspv -nohipwrapperinc \
44 // RUN: %s 2>&1 \
45 // RUN: | FileCheck -DVERSION=%llvm-version-major \
46 // RUN: --check-prefix=VERSIONED %s
47
48 // VERSIONED: {{.*}}llvm-spirv-[[VERSION]]