From 549538ee93de23e905e2d94f7d2ed4b37f68797d Mon Sep 17 00:00:00 2001 From: "Jiang, Zhiwei" Date: Wed, 8 May 2024 13:02:21 +0800 Subject: [PATCH] Add test Signed-off-by: Jiang, Zhiwei --- clang/test/dpct/user_cuda_file/cuda.h | 7 +++++++ clang/test/dpct/user_cuda_file/test.cu | 12 ++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 clang/test/dpct/user_cuda_file/cuda.h create mode 100644 clang/test/dpct/user_cuda_file/test.cu diff --git a/clang/test/dpct/user_cuda_file/cuda.h b/clang/test/dpct/user_cuda_file/cuda.h new file mode 100644 index 000000000000..fae2307a6e92 --- /dev/null +++ b/clang/test/dpct/user_cuda_file/cuda.h @@ -0,0 +1,7 @@ +#ifndef __MY_CUDA_H__ +#define __MY_CUDA_H__ + +// CHECK: sycl::float3 f3; +float3 f3; + +#endif // __MY_CUDA_H__ diff --git a/clang/test/dpct/user_cuda_file/test.cu b/clang/test/dpct/user_cuda_file/test.cu new file mode 100644 index 000000000000..ba7f7e65b5fb --- /dev/null +++ b/clang/test/dpct/user_cuda_file/test.cu @@ -0,0 +1,12 @@ +// RUN: dpct --out-root %T %s --cuda-include-path="%cuda-path/include" +// RUN: FileCheck %s --match-full-lines --input-file %T/test.dp.cpp +// RUN: FileCheck %S/cuda.h --match-full-lines --input-file %T/cuda.h +// RUN: %if build_lit %{icpx -c -fsycl %T/test.dp.cpp -o %T/test.dp.o %} + +#include "cuda.h" + +int main() { + // CHECK: sycl::float2 f2; + float2 f2; + return 0; +}