1 // REQUIRES: x86-registered-target
2 // REQUIRES: amdgpu-registered-target
4 // UNSUPPORTED: system-windows
6 // RUN: %clang -c -### -target x86_64-unknown-linux-gnu --cuda-gpu-arch=gfx900 \
7 // RUN: -std=c++11 --rocm-path=%S/Inputs/rocm -nogpulib %s 2>&1 \
8 // RUN: | FileCheck -check-prefixes=COMMON,CLANG,HIP %s
10 // RUN: %clang -c -### -target x86_64-unknown-linux-gnu --cuda-gpu-arch=gfx900 \
11 // RUN: -std=c++11 --rocm-path=%S/Inputs/rocm -nobuiltininc -nogpulib %s 2>&1 \
12 // RUN: | FileCheck -check-prefixes=COMMON,NOCLANG,HIP %s
14 // RUN: %clang -c -### -target x86_64-unknown-linux-gnu --cuda-gpu-arch=gfx900 \
15 // RUN: -std=c++11 --rocm-path=%S/Inputs/rocm -nogpuinc -nogpulib %s 2>&1 \
16 // RUN: | FileCheck -check-prefixes=COMMON,CLANG,NOHIP %s
18 // COMMON-LABEL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
19 // CLANG-SAME: "-internal-isystem" "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include/cuda_wrappers"
20 // NOCLANG-NOT: "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include/cuda_wrappers"
21 // HIP-SAME: "-idirafter" "{{[^"]*}}Inputs/rocm/include"
22 // HIP-SAME: "-include" "__clang_hip_runtime_wrapper.h"
23 // NOHIP-NOT: "-include" "__clang_hip_runtime_wrapper.h"
24 // skip check of standard C++ include path
25 // CLANG-SAME: "-internal-isystem" "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include"
26 // NOCLANG-NOT: "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include"
27 // NOHIP-NOT: "{{.*}}Inputs/rocm/include"
29 // COMMON-LABEL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
30 // CLANG-SAME: "-internal-isystem" "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include/cuda_wrappers"
31 // NOCLANG-NOT: "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include/cuda_wrappers"
32 // HIP-SAME: "-idirafter" "{{[^"]*}}Inputs/rocm/include"
33 // HIP-SAME: "-include" "__clang_hip_runtime_wrapper.h"
34 // NOHIP-NOT: "-include" "__clang_hip_runtime_wrapper.h"
35 // skip check of standard C++ include path
36 // CLANG-SAME: "-internal-isystem" "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include"
37 // NOCLANG-NOT: "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include"
38 // NOHIP-NOT: "{{.*}}Inputs/rocm/include"
40 // RUN: %clang -c -### -target x86_64-unknown-linux-gnu --cuda-gpu-arch=gfx900 \
41 // RUN: -std=c++11 --rocm-path=%S/Inputs/rocm -nogpulib %s 2>&1 \
42 // RUN: --hip-version=3.5 | FileCheck -check-prefixes=ROCM35 %s
44 // ROCM35-LABEL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
45 // ROCM35-NOT: "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include/cuda_wrappers"
46 // ROCM35-SAME: "-internal-isystem" "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}"
47 // ROCM35-SAME: "-idirafter" "{{[^"]*}}Inputs/rocm/include"
48 // ROCM35-NOT: "-include" "__clang_hip_runtime_wrapper.h"
49 // skip check of standard C++ include path
50 // ROCM35-SAME: "-internal-isystem" "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include"