Skip to content

Commit 5434328

Browse files
committed
[SYCL] Add tests for -nostdlib
1 parent 34092a3 commit 5434328

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

clang/test/Driver/sycl-offload.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,11 @@
634634
// CHECK-LD-NOLIBSYCL: "{{.*}}ld{{(.exe)?}}"
635635
// CHECK-LD-NOLIBSYCL-NOT: "-lsycl"
636636

637+
/// Check no SYCL runtime is linked with -nostdlib
638+
// RUN: %clang -fsycl -nostdlib -target x86_64-unknown-linux-gnu %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LD-NOSTDLIB %s
639+
// CHECK-LD-NOSTDLIB: "{{.*}}ld{{(.exe)?}}"
640+
// CHECK-LD-NOSTDLIB-NOT: "-lsycl"
641+
637642
/// Check for default linking of sycl.lib with -fsycl usage
638643
// RUN: %clang -fsycl -target x86_64-unknown-windows-msvc %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-SYCL %s
639644
// RUN: %clang_cl -fsycl %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-SYCL-CL %s
@@ -643,11 +648,19 @@
643648

644649
/// Check no SYCL runtime is linked with -nolibsycl
645650
// RUN: %clang -fsycl -nolibsycl -target x86_64-unknown-windows-msvc %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-NOLIBSYCL %s
646-
// RUN: %clang_cl -fsycl -nolibsycl %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-NOLIBSYCL %s
647-
// CHECK-LINK-NOLIBSYCL-NOT: "--dependent-lib=sycl"
651+
// RUN: %clang_cl -fsycl -nolibsycl %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-NOLIBSYCL-CL %s
652+
// CHECK-LINK-NOLIBSYCL-CL-NOT: "--dependent-lib=sycl"
648653
// CHECK-LINK-NOLIBSYCL: "{{.*}}link{{(.exe)?}}"
649654
// CHECK-LINK-NOLIBSYCL-NOT: "-defaultlib:sycl.lib"
650655

656+
/// Check SYCL runtime is linked despite -nostdlib on Windows, this is
657+
/// necessary for the Windows Clang CMake to work
658+
// RUN: %clang -fsycl -nostdlib -target x86_64-unknown-windows-msvc %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-NOSTDLIB %s
659+
// RUN: %clang_cl -fsycl -nostdlib %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-NOSTDLIB-CL %s
660+
// CHECK-LINK-NOSTDLIB-CL: "--dependent-lib=sycl"
661+
// CHECK-LINK-NOSTDLIB: "{{.*}}link{{(.exe)?}}"
662+
// CHECK-LINK-NOSTDLIB: "-defaultlib:sycl.lib"
663+
651664
/// Check sycld.lib is chosen with /MDd
652665
// RUN: %clang_cl -fsycl /MDd %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-SYCL-DEBUG %s
653666
// CHECK-LINK-SYCL-DEBUG: "--dependent-lib=sycld"

0 commit comments

Comments
 (0)