|
29 | 29 | // RUN: --sycl-post-link-options="-O2 -device-globals -O0" \ |
30 | 30 | // RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck --check-prefix OPTIONS_POSTLINK_JIT_NEW_SYCLBIN %s |
31 | 31 | // OPTIONS_POSTLINK_JIT_NEW_SYCLBIN: sycl-post-link{{.*}} -spec-const=native -properties -split=auto -emit-only-kernels-as-entry-points -emit-param-info -symbols -emit-kernel-names -emit-exported-symbols -emit-imported-symbols -split-esimd -lower-esimd -O2 -device-globals -O0 |
| 32 | +// |
| 33 | +// Ensure driver forwards these triple based options to clang-linker-wrapper. |
| 34 | +// |
| 35 | +// RUN: %clangxx %s -### -fsycl --offload-new-driver \ |
| 36 | +// RUN: -fsycl-remove-unused-external-funcs \ |
| 37 | +// RUN: -fsycl-device-code-split-esimd \ |
| 38 | +// RUN: -fsycl-add-default-spec-consts-image \ |
| 39 | +// RUN: 2>&1 | FileCheck --check-prefix=OPTIONS_FORWARD %s |
| 40 | +// OPTIONS_FORWARD: clang-linker-wrapper{{.*}} "-sycl-remove-unused-external-funcs" "-sycl-device-code-split-esimd" "-sycl-add-default-spec-consts-image" |
| 41 | +// |
| 42 | +// RUN: %clangxx %s -### -fsycl --offload-new-driver \ |
| 43 | +// RUN: -fno-sycl-remove-unused-external-funcs \ |
| 44 | +// RUN: -fno-sycl-device-code-split-esimd \ |
| 45 | +// RUN: -fno-sycl-add-default-spec-consts-image \ |
| 46 | +// RUN: 2>&1 | FileCheck --check-prefix=OPTIONS_FORWARD_NO %s |
| 47 | +// OPTIONS_FORWARD_NO: clang-linker-wrapper{{.*}} "-no-sycl-remove-unused-external-funcs" "-no-sycl-device-code-split-esimd" "-no-sycl-add-default-spec-consts-image" |
| 48 | +// |
| 49 | +// Check -no-sycl-remove-unused-external-funcs option disables emitting |
| 50 | +// -emit-only-kernels-as-entry-points in sycl-post-link. |
| 51 | +// RUN: clang-linker-wrapper --dry-run --host-triple=x86_64-unknown-linux-gnu \ |
| 52 | +// RUN: -sycl-device-libraries=%t.devicelib.o \ |
| 53 | +// RUN: -no-sycl-remove-unused-external-funcs \ |
| 54 | +// RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck --check-prefix OPTIONS_NO_EMIT_ONLY_KERNELS %s |
| 55 | +// OPTIONS_NO_EMIT_ONLY_KERNELS: sycl-post-link{{.*}} -spec-const=native -properties -split=auto -emit-param-info -symbols -emit-exported-symbols -emit-imported-symbols -split-esimd -lower-esimd |
| 56 | +// |
| 57 | +// Check -no-sycl-device-code-split-esimd option disables emitting |
| 58 | +// -split-esimd in sycl-post-link. |
| 59 | +// RUN: clang-linker-wrapper --dry-run --host-triple=x86_64-unknown-linux-gnu \ |
| 60 | +// RUN: -sycl-device-libraries=%t.devicelib.o \ |
| 61 | +// RUN: -no-sycl-device-code-split-esimd \ |
| 62 | +// RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck --check-prefix OPTIONS_NO_SPLIT_ESIMD %s |
| 63 | +// OPTIONS_NO_SPLIT_ESIMD: sycl-post-link{{.*}} -spec-const=native -properties -split=auto -emit-only-kernels-as-entry-points -emit-param-info -symbols -emit-exported-symbols -emit-imported-symbols -lower-esimd |
| 64 | +// |
| 65 | +// Generate AOT .o file as linker wrapper input. |
| 66 | +// |
| 67 | +// RUN: %clang %s -fsycl -fsycl-targets=spir64_gen-unknown-unknown -c --offload-new-driver -o %t_aot.o |
| 68 | +// |
| 69 | +// Generate AOT .o file as SYCL device library file. |
| 70 | +// |
| 71 | +// RUN: touch %t.devicelib.cpp |
| 72 | +// RUN: %clang %t.devicelib.cpp -fsycl -fsycl-targets=spir64_gen-unknown-unknown -c --offload-new-driver -o %t.devicelib_aot.o |
| 73 | +// |
| 74 | +// Check -sycl-add-default-spec-consts-image option enables emitting |
| 75 | +// -generate-device-image-default-spec-consts in sycl-post-link. |
| 76 | +// RUN: clang-linker-wrapper --dry-run --host-triple=x86_64-unknown-linux-gnu \ |
| 77 | +// RUN: -sycl-device-libraries=%t.devicelib_aot.o \ |
| 78 | +// RUN: -sycl-add-default-spec-consts-image \ |
| 79 | +// RUN: --linker-path=/usr/bin/ld %t_aot.o -o a.out 2>&1 | FileCheck --check-prefix OPTIONS_DEFAULT_SPEC_CONSTS %s |
| 80 | +// OPTIONS_DEFAULT_SPEC_CONSTS: sycl-post-link{{.*}} -spec-const=emulation -properties -split=auto -emit-only-kernels-as-entry-points -emit-param-info -symbols -emit-exported-symbols -emit-imported-symbols -split-esimd -lower-esimd -generate-device-image-default-spec-consts |
0 commit comments