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