1 // REQUIRES: x86-registered-target
2 // UNSUPPORTED: system-windows
4 // RUN: %clang -### -target x86_64-linux-gnu --offload=spirv64 \
5 // RUN: --hip-path=%S/Inputs/hipspv -nohipwrapperinc %s \
6 // RUN: 2>&1 | FileCheck %s
8 // CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "spirv64"
9 // CHECK-SAME: "-aux-triple" "{{.*}}" "-emit-llvm-bc"
10 // CHECK-SAME: "-fcuda-is-device"
11 // CHECK-SAME: "-fcuda-allow-variadic-functions"
12 // CHECK-SAME: "-mlink-builtin-bitcode" {{".*/hipspv/lib/hip-device-lib/hipspv-spirv64.bc"}}
13 // CHECK-SAME: "-isystem" {{".*/hipspv/include"}}
14 // CHECK-SAME: "-fhip-new-launch-api"
15 // CHECK-SAME: "-o" [[DEV_BC:".*bc"]]
16 // CHECK-SAME: "-x" "hip"
18 // CHECK: {{".*llvm-link"}} [[DEV_BC]] "-o" [[LINK_BC:".*bc"]]
20 // CHECK: {{".*opt"}} [[LINK_BC]] "-load-pass-plugin"
21 // CHECK-SAME: {{".*/hipspv/lib/libLLVMHipSpvPasses.so"}}
22 // CHECK-SAME: "-passes=hip-post-link-passes" "-o" [[LOWER_BC:".*bc"]]
24 // CHECK: {{".*llvm-spirv"}} "--spirv-max-version=1.1" "--spirv-ext=+all"
25 // CHECK-SAME: [[LOWER_BC]] "-o" "[[SPIRV_OUT:.*out]]"
27 // CHECK: {{".*clang-offload-bundler"}} "-type=o" "-bundle-align=4096"
28 // CHECK-SAME: "-targets=host-x86_64-unknown-linux,hip-spirv64----generic"
29 // CHECK-SAME: "-input={{.*}}" "-input=[[SPIRV_OUT]]" "-output=[[BUNDLE:.*hipfb]]"
31 // CHECK: [[CLANG]] "-cc1" "-triple" {{".*"}} "-aux-triple" "spirv64"
32 // CHECK-SAME: "-emit-obj"
33 // CHECK-SAME: "-fcuda-include-gpubinary" "[[BUNDLE]]"
34 // CHECK-SAME: "-o" [[OBJ_HOST:".*o"]] "-x" "hip"
36 // CHECK: {{".*ld.*"}} {{.*}}[[OBJ_HOST]]