Skip to content

Commit e115458

Browse files
authored
[SYCLomatic] [NFC] Fix soft link cases failed when directory doesn't exist. (#2249)
Signed-off-by: Chen, Sheng S <[email protected]>
1 parent d11a3a4 commit e115458

File tree

8 files changed

+17
-27
lines changed

8 files changed

+17
-27
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
just for test
2+

clang/test/dpct/soft_link/soft_link_dir/vector_add_format.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// UNSUPPORTED: system-windows
2-
// RUN: cd %S/link && rm -rf test && ln -nfs ../target test
3-
// RUN: dpct --in-root=%S --out-root=%T/out --cuda-include-path="%cuda-path/include" --process-all -- -I %S/link/test -x cuda --cuda-host-only
2+
// RUN: cp -r %S %T && cd %T/soft_link_dir/link && rm -rf test && ln -nfs ../target test
3+
// RUN: dpct --in-root=%T/soft_link_dir --out-root=%T/out --cuda-include-path="%cuda-path/include" --process-all -- -I %T/soft_link_dir/link/test -x cuda --cuda-host-only
44
// RUN: FileCheck --input-file %T/out/vector_add_format.dp.cpp --match-full-lines %s
5-
// RUN: FileCheck --input-file %T/out/link/test/test/test.hpp --match-full-lines %S/link/test/test/test.hpp
5+
// RUN: FileCheck --input-file %T/out/link/test/test/test.hpp --match-full-lines %T/soft_link_dir/link/test/test/test.hpp
66
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/out/vector_add_format.dp.cpp -o %T/out/vector_add_format.dp.o -I %T/out/link/test %}
77

88
#include <cuda.h>
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
// CHECK: #include <sycl/sycl.hpp>
2-
// CHECK: #include <dpct/dpct.hpp>
3-
#include <cuda.h>
4-
int test() {
5-
return 0;
6-
}
1+
../../target/test/test.hpp

clang/test/dpct/soft_link/soft_link_file/vector_add_format.cu

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// UNSUPPORTED: system-windows
2-
// RUN: cd %S/link/test && rm test.hpp && ln -nfs ../../target/test/test.hpp test.hpp
3-
// RUN: dpct --in-root=%S --out-root=%T/out --cuda-include-path="%cuda-path/include" --process-all -- -I %S/link -x cuda --cuda-host-only
4-
// RUN: FileCheck --input-file %T/out/vector_add_format.dp.cpp --match-full-lines %s
5-
// RUN: FileCheck --input-file %T/out/link/test/test.hpp --match-full-lines %S/link/test/test.hpp
2+
// RUN: cp -r %S %T && cd %T/soft_link_file/link/test && rm test.hpp && ln -nfs ../../target/test/test.hpp test.hpp
3+
// RUN: dpct --in-root=%T/soft_link_file --out-root=%T/out --cuda-include-path="%cuda-path/include" --process-all -- -I %T/soft_link_file/link -x cuda --cuda-host-only
4+
// RUN: FileCheck --input-file %T/out/link/test/test.hpp --match-full-lines %T/soft_link_file/link/test/test.hpp
65
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/out/vector_add_format.dp.cpp -o %T/out/vector_add_format.dp.o -I %T/out/link %}
76

87
#include <cuda.h>
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
// CHECK: #include <sycl/sycl.hpp>
2-
// CHECK: #include <dpct/dpct.hpp>
3-
#include <cuda.h>
4-
int test() {
5-
return 0;
6-
}
1+
../../target/test/test.cuh

clang/test/dpct/soft_link/soft_link_file_rename/vector_add_format.cu

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// UNSUPPORTED: system-windows
2-
// RUN: cd %S/link/test && rm test.cuh && ln -nfs ../../target/test/test.cuh test.cuh
3-
// RUN: dpct --in-root=%S --out-root=%T/out --cuda-include-path="%cuda-path/include" --process-all -- -I %S/link -x cuda --cuda-host-only
4-
// RUN: FileCheck --input-file %T/out/vector_add_format.dp.cpp --match-full-lines %s
5-
// RUN: FileCheck --input-file %T/out/link/test/test.dp.hpp --match-full-lines %S/link/test/test.cuh
2+
// RUN: cp -r %S %T && cd %T/soft_link_file_rename/link/test && rm test.cuh && ln -nfs ../../target/test/test.cuh test.cuh
3+
// RUN: dpct --in-root=%T/soft_link_file_rename --out-root=%T/out --cuda-include-path="%cuda-path/include" --process-all -- -I %T/soft_link_file_rename/link -x cuda --cuda-host-only
4+
// RUN: FileCheck --input-file %T/out/link/test/test.dp.hpp --match-full-lines %T/soft_link_file_rename/link/test/test.cuh
65
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/out/vector_add_format.dp.cpp -o %T/out/vector_add_format.dp.o -I %T/out/link %}
76

87
#include <cuda.h>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../target

clang/test/dpct/soft_link/soft_link_mul_dir2/vector_add_format.cu

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// UNSUPPORTED: system-windows
2-
// RUN: cd %S/link/hello && rm -rf target_soft_link && ln -nfs ../../target target_soft_link && cd %S/link && rm -rf link && ln -nfs hello link
3-
// RUN: dpct --in-root=%S --out-root=%T/out --cuda-include-path="%cuda-path/include" --process-all -- -I %S/link/link/target_soft_link -x cuda --cuda-host-only
4-
// RUN: FileCheck --input-file %T/out/vector_add_format.dp.cpp --match-full-lines %s
5-
// RUN: FileCheck --input-file %T/out/link/link/target_soft_link/test/test.hpp --match-full-lines %S/target/test/test.hpp
2+
// RUN: cp -r %S %T && cd %T/soft_link_mul_dir2/link/hello && rm -rf target_soft_link && ln -nfs ../../target target_soft_link && cd %T/soft_link_mul_dir2/link && rm -rf link && ln -nfs hello link
3+
// RUN: dpct --in-root=%T/soft_link_mul_dir2 --out-root=%T/out --cuda-include-path="%cuda-path/include" --process-all -- -I %T/soft_link_mul_dir2/link/link/target_soft_link -x cuda --cuda-host-only
4+
// RUN: FileCheck --input-file %T/out/link/link/target_soft_link/test/test.hpp --match-full-lines %T/soft_link_mul_dir2/target/test/test.hpp
65
// RUN: %if build_lit %{icpx -c -fsycl -DBUILD_TEST %T/out/vector_add_format.dp.cpp -o %T/out/vector_add_format.dp.o -I %T/out/link/hello/target_soft_link %}
76

87
#include <cuda.h>

0 commit comments

Comments
 (0)