Skip to content

Commit 15f5d0c

Browse files
committed
add lit test
Signed-off-by: chenwei.sun <chenwei.sun@intel.com>
1 parent c063f34 commit 15f5d0c

3 files changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// CHECK: MainSourceFilesDigest:
2+
// CHECK-NEXT: - MainSourceFile: '{{(.+)}}common.cpp'
3+
// CHECK-NEXT: Digest: {{(.+)}}
4+
// CHECK-NEXT: HasCUDASyntax: false
5+
// CHECK-NEXT: - MainSourceFile: '{{(.+)}}yaml_has_cuda_syntax/utils.cpp'
6+
// CHECK-NEXT: Digest: {{(.+)}}
7+
// CHECK-NEXT: HasCUDASyntax: true
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// UNSUPPORTED: system-windows
2+
// RUN: echo "[" > %T/compile_commands.json
3+
// RUN: echo " {" >> %T/compile_commands.json
4+
// RUN: echo " \"command\": \"nvcc %S/common.cpp\"," >> %T/compile_commands.json
5+
// RUN: echo " \"directory\": \"%T\"," >> %T/compile_commands.json
6+
// RUN: echo " \"file\": \"%S/common.cpp\"" >> %T/compile_commands.json
7+
// RUN: echo " }," >> %T/compile_commands.json
8+
// RUN: echo " {" >> %T/compile_commands.json
9+
// RUN: echo " \"command\": \"nvcc %S/utils.cpp\"," >> %T/compile_commands.json
10+
// RUN: echo " \"directory\": \"%T\"," >> %T/compile_commands.json
11+
// RUN: echo " \"file\": \"%S/utils.cpp\"" >> %T/compile_commands.json
12+
// RUN: echo " }" >> %T/compile_commands.json
13+
// RUN: echo "]" >> %T/compile_commands.json
14+
15+
// RUN: dpct -in-root=%S -p=%T --out-root=%T/out --cuda-include-path="%cuda-path/include"
16+
// RUN: FileCheck %s --match-full-lines --input-file %T/out/common.cpp
17+
// RUN: %if build_lit %{icpx -c -fsycl %T/out/common.cpp -o %T/out/common.o %}
18+
19+
// RUN: FileCheck %S/utils.cpp --match-full-lines --input-file %T/out/utils.cpp.dp.cpp
20+
// RUN: %if build_lit %{icpx -c -fsycl %T/out/utils.cpp.dp.cpp -o %T/out/ utils.cpp.dp.o %}
21+
22+
// RUN: cat %S/MainSourceFiles.ref > %T/out/check_MainSourceFiles.yaml
23+
// RUN: cat %T/out/MainSourceFiles.yaml >>%T/out/check_MainSourceFiles.yaml
24+
// RUN: FileCheck --match-full-lines --input-file %T/out/check_MainSourceFiles.yaml %T/out/check_MainSourceFiles.yaml
25+
26+
// CHECK: #include <cmath>
27+
28+
void test() {
29+
int a = -1;
30+
// CHECK: abs(a);
31+
abs(a);
32+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// UNSUPPORTED: system-windows
2+
// RUN: echo "empty command"
3+
4+
5+
#include <iostream>
6+
#include <cuda_runtime.h>
7+
8+
// CHECK: void test_foo(){
9+
__device__ void test_foo(void){
10+
}

0 commit comments

Comments
 (0)