Skip to content

Commit 01a7cec

Browse files
author
Martin Wehking
committed
Add check for -only-needed flag
1 parent 9f0aa30 commit 01a7cec

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

clang/test/Driver/sycl-device-lib-amdgcn.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,10 @@
4242
// CHK-ALL: [[DEVLIB:[0-9]+]]: input, "{{.*}}devicelib--amd.bc", ir, (device-sycl, gfx906)
4343
// CHK-ALL: {{[0-9]+}}: linker, {{{.*}}[[DEVLIB]]{{.*}}}, ir, (device-sycl, gfx906)
4444

45+
// Check that llvm-link uses the "-only-needed" flag.
46+
// Not using the flag breaks kernel bundles.
47+
// RUN: %clangxx -### -std=c++11 -nogpulib --sysroot=%S/Inputs/SYCL \
48+
// RUN: -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \
49+
// RUN: | FileCheck -check-prefix=CHK-ONLY-NEEDED %s
50+
51+
// CHK-ONLY-NEEDED: llvm-link"{{.*}}"-only-needed"{{.*}}"{{.*}}devicelib--amd.bc"{{.*}}

clang/test/Driver/sycl-device-lib-nvptx.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,10 @@
4242
// CHK-ALL: [[DEVLIB:[0-9]+]]: input, "{{.*}}devicelib--cuda.bc", ir, (device-sycl, sm_50)
4343
// CHK-ALL: {{[0-9]+}}: linker, {{{.*}}[[DEVLIB]]{{.*}}}, ir, (device-sycl, sm_50)
4444

45+
// Check that llvm-link uses the "-only-needed" flag.
46+
// Not using the flag breaks kernel bundles.
47+
// RUN: %clangxx -### -std=c++11 --sysroot=%S/Inputs/SYCL \
48+
// RUN: -fsycl -fsycl-targets=nvptx64-nvidia-cuda %s 2>&1 \
49+
// RUN: | FileCheck -check-prefix=CHK-ONLY-NEEDED %s
50+
51+
// CHK-ONLY-NEEDED: llvm-link"{{.*}}"-only-needed"{{.*}}"{{.*}}devicelib--cuda.bc"{{.*}}

0 commit comments

Comments
 (0)