|
| 1 | +// Tests specific to `-fsycl-targets=amdgcn-amd-amdhsa` |
| 2 | +// Verify that the correct devicelib linking actions are spawned by the driver. |
| 3 | +// Check also if the correct warnings are generated. |
| 4 | + |
| 5 | +// UNSUPPORTED: system-windows |
| 6 | +// REQUIRES: amdgpu-registered-target |
| 7 | + |
| 8 | +// Check if internal libraries are still linked against when linkage of all |
| 9 | +// device libs is manually excluded. |
| 10 | +// RUN: %clangxx -ccc-print-phases -std=c++11 -fsycl -fno-sycl-device-lib=all --sysroot=%S/Inputs/SYCL \ |
| 11 | +// RUN: -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \ |
| 12 | +// RUN: | FileCheck -check-prefix=CHK-NO-DEVLIB %s |
| 13 | + |
| 14 | +// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib--amd.bc", ir, (device-sycl, gfx906) |
| 15 | +// CHK-NO-DEVLIB: [[LIB1:[0-9]+]]: input, "{{.*}}libsycl-itt-user-wrappers.bc", ir, (device-sycl, gfx906) |
| 16 | +// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib--amd.bc", ir, (device-sycl, gfx906) |
| 17 | +// CHK-NO-DEVLIB: [[LIB2:[0-9]+]]: input, "{{.*}}libsycl-itt-compiler-wrappers.bc", ir, (device-sycl, gfx906) |
| 18 | +// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib--amd.bc", ir, (device-sycl, gfx906) |
| 19 | +// CHK-NO-DEVLIB: [[LIB3:[0-9]+]]: input, "{{.*}}libsycl-itt-stubs.bc", ir, (device-sycl, gfx906) |
| 20 | +// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib--amd.bc", ir, (device-sycl, gfx906) |
| 21 | +// CHK-NO-DEVLIB: {{[0-9]+}}: linker, {{{.*}}[[LIB1]], [[LIB2]], [[LIB3]]{{.*}}}, ir, (device-sycl, gfx906) |
| 22 | + |
| 23 | +// Check that the -fsycl-device-lib flag has no effect when "all" is specified. |
| 24 | +// RUN: %clangxx -ccc-print-phases -std=c++11 -fsycl -fsycl-device-lib=all --sysroot=%S/Inputs/SYCL \ |
| 25 | +// RUN: -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \ |
| 26 | +// RUN: | FileCheck -check-prefix=CHK-ALL %s |
| 27 | + |
| 28 | +// Check that the -fsycl-device-lib flag has no effect when subsets of libs |
| 29 | +// are specified. |
| 30 | +// RUN: %clangxx -ccc-print-phases -std=c++11 --sysroot=%S/Inputs/SYCL \ |
| 31 | +// RUN: -fsycl -fsycl-device-lib=libc,libm-fp32,libm-fp64,libimf-fp32,libimf-fp64,libimf-bf16,libm-bfloat16 \ |
| 32 | +// RUN: -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \ |
| 33 | +// RUN: | FileCheck -check-prefix=CHK-ALL %s |
| 34 | + |
| 35 | +// Check that -fno-sycl-device-lib is ignored when it does not contain "all". |
| 36 | +// A warning should be printed that the flag got ignored. |
| 37 | +// RUN: %clangxx -ccc-print-phases -std=c++11 -fsycl --sysroot=%S/Inputs/SYCL \ |
| 38 | +// RUN: -fno-sycl-device-lib=libc,libm-fp32,libm-fp64,libimf-fp32,libimf-fp64,libimf-bf16,libm-bfloat16 \ |
| 39 | +// RUN: -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \ |
| 40 | +// RUN: | FileCheck -check-prefixes=CHK-UNUSED-WARN,CHK-ALL %s |
| 41 | + |
| 42 | +// CHK-UNUSED-WARN: warning: argument unused during compilation: '-fno-sycl-device-lib=' |
| 43 | +// CHK-ALL: [[DEVLIB:[0-9]+]]: input, "{{.*}}devicelib--amd.bc", ir, (device-sycl, gfx906) |
| 44 | +// CHK-ALL: {{[0-9]+}}: linker, {{{.*}}[[DEVLIB]]{{.*}}}, ir, (device-sycl, gfx906) |
| 45 | + |
0 commit comments