|
| 1 | +// This test emits an error or a warning if -fsycl-* options are not used in |
| 2 | +// conjunction with -fsycl. |
| 3 | + |
| 4 | +// Error should be emitted when using -fsycl-host-compiler without -fsycl |
| 5 | + |
| 6 | +// RUN: %clang -### -fsycl-host-compiler=g++ %s 2>&1 \ |
| 7 | +// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL %s |
| 8 | +// RUN: %clang_cl -### -fsycl-host-compiler=g++ %s 2>&1 \ |
| 9 | +// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL %s |
| 10 | +// CHK-NO-FSYCL: error: '-fsycl-host-compiler' must be used in conjunction with '-fsycl' to enable offloading |
| 11 | + |
| 12 | +// Warning should be emitted when using -fsycl-host-compiler-options without -fsycl-host-compiler |
| 13 | +// RUN: %clang -### -fsycl -fsycl-host-compiler-options="-g" %s 2>&1 \ |
| 14 | +// RUN: | FileCheck -check-prefix=CHK-FSYCL-WARNING %s |
| 15 | +// RUN: %clang_cl -### -fsycl -fsycl-host-compiler-options="-g" %s 2>&1 \ |
| 16 | +// RUN: | FileCheck -check-prefix=CHK-FSYCL-WARNING %s |
| 17 | +// CHK-FSYCL-WARNING: warning: '-fsycl-host-compiler-options' should be used only in conjunction with '-fsycl-host-compiler' |
| 18 | + |
| 19 | +// Warning should be emitted when using -fsycl-dead-args-optimization without -fsycl |
| 20 | +// RUN: %clang -### -fsycl-dead-args-optimization %s 2>&1 \ |
| 21 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-dead-args-optimization %s |
| 22 | +// RUN: %clang_cl -### -fsycl-dead-args-optimization %s 2>&1 \ |
| 23 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-dead-args-optimization %s |
| 24 | + |
| 25 | +// Warning should be emitted when using -fsycl-device-lib-jit-link without -fsycl |
| 26 | +// RUN: %clang -### -fsycl-device-lib-jit-link %s 2>&1 \ |
| 27 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-lib-jit-link %s |
| 28 | +// RUN: %clang_cl -### -fsycl-device-lib-jit-link %s 2>&1 \ |
| 29 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-lib-jit-link %s |
| 30 | + |
| 31 | +// Warning should be emitted when using -fsycl-default-sub-group-size= without -fsycl |
| 32 | +// RUN: %clang -### -fsycl-default-sub-group-size=10 %s 2>&1 \ |
| 33 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-default-sub-group-size=10 %s |
| 34 | +// RUN: %clang_cl -### -fsycl-default-sub-group-size=10 %s 2>&1 \ |
| 35 | +// RUN: | FileCheck -check-prefix=WARNING-DSS-CL %s |
| 36 | +// WARNING-DSS-CL: unknown argument ignored in clang-cl: '-fsycl-default-sub-group-size=10' [-Wunknown-argument] |
| 37 | + |
| 38 | +// Warning should be emitted when using -fsycl-device-code-split-esimd without -fsycl |
| 39 | +// RUN: %clang -### -fsycl-device-code-split-esimd %s 2>&1 \ |
| 40 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-code-split-esimd %s |
| 41 | + |
| 42 | +// Warning should be emitted when using -fsycl-device-lib=libc without -fsycl |
| 43 | +// RUN: %clang -### -fsycl-device-lib=libc %s 2>&1 \ |
| 44 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-lib=libc %s |
| 45 | +// RUN: %clang_cl -### -fsycl-device-lib=libc %s 2>&1 \ |
| 46 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-lib=libc %s |
| 47 | + |
| 48 | +// Warning should be emitted when using -fsycl-device-obj=spirv without -fsycl |
| 49 | +// RUN: %clang -### -fsycl-device-obj=spirv %s 2>&1 \ |
| 50 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-obj=spirv %s |
| 51 | +// RUN: %clang_cl -### -fsycl-device-obj=spirv %s 2>&1 \ |
| 52 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-device-obj=spirv %s |
| 53 | + |
| 54 | +// Warning should not be emitted when using -fsycl-device-only without -fsycl |
| 55 | +// RUN: %clang -### -fsycl-device-only %s 2>&1 \ |
| 56 | +// RUN: | FileCheck -check-prefix=WARNING-DEVICE-ONLY -DOPT=-fsycl-device-only %s |
| 57 | +// RUN: %clang_cl -### -fsycl-device-only %s 2>&1 \ |
| 58 | +// RUN: | FileCheck -check-prefix=WARNING-DEVICE-ONLY -DOPT=-fsycl-device-only %s |
| 59 | +// WARNING-DEVICE-ONLY-NOT: warning: argument unused during compilation: '[[OPT]]' [-Wunused-command-line-argument] |
| 60 | + |
| 61 | +// Warning should be emitted when using -fsycl-early-optimizations without -fsycl |
| 62 | +// RUN: %clang -### -fsycl-early-optimizations %s 2>&1 \ |
| 63 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-early-optimizations %s |
| 64 | +// RUN: %clang_cl -### -fsycl-early-optimizations %s 2>&1 \ |
| 65 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-early-optimizations %s |
| 66 | + |
| 67 | +// Warning should be emitted when using -fsycl-embed-ir without -fsycl |
| 68 | +// RUN: %clang -### -fsycl-embed-ir %s 2>&1 \ |
| 69 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-embed-ir %s |
| 70 | +// RUN: %clang_cl -### -fsycl-embed-ir %s 2>&1 \ |
| 71 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-embed-ir %s |
| 72 | + |
| 73 | +// Warning should be emitted when using -fsycl-esimd-force-stateless-mem without -fsycl |
| 74 | +// RUN: %clang -### -fsycl-esimd-force-stateless-mem %s 2>&1 \ |
| 75 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-esimd-force-stateless-mem %s |
| 76 | +// RUN: %clang_cl -### -fsycl-esimd-force-stateless-mem %s 2>&1 \ |
| 77 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-esimd-force-stateless-mem %s |
| 78 | + |
| 79 | +// Warning should be emitted when using -fsycl-force-inline-kernel-lambda without -fsycl |
| 80 | +// RUN: %clang -### -fsycl-force-inline-kernel-lambda %s 2>&1 \ |
| 81 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-force-inline-kernel-lambda %s |
| 82 | +// RUN: %clang_cl -### -fsycl-force-inline-kernel-lambda %s 2>&1 \ |
| 83 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-force-inline-kernel-lambda %s |
| 84 | + |
| 85 | +// Warning should be emitted when using -fsycl-fp32-prec-sqrt without -fsycl |
| 86 | +// RUN: %clang -### -fsycl-fp32-prec-sqrt %s 2>&1 \ |
| 87 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-fp32-prec-sqrt %s |
| 88 | +// RUN: %clang_cl -### -fsycl-fp32-prec-sqrt %s 2>&1 \ |
| 89 | +// RUN: | FileCheck -check-prefix=WARNING-FP32-CL -DOPT=-fsycl-fp32-prec-sqrt %s |
| 90 | +// WARNING-FP32-CL: warning: unknown argument ignored in clang-cl: '[[OPT]]' [-Wunknown-argument] |
| 91 | + |
| 92 | +// Warning should be emitted when using -fsycl-id-queries-fit-in-int without -fsycl |
| 93 | +// RUN: %clang -### -fsycl-id-queries-fit-in-int %s 2>&1 \ |
| 94 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-id-queries-fit-in-int %s |
| 95 | +// RUN: %clang_cl -### -fsycl-id-queries-fit-in-int %s 2>&1 \ |
| 96 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-id-queries-fit-in-int %s |
| 97 | + |
| 98 | +// Warning should be emitted when using -fsycl-instrument-device-code without -fsycl |
| 99 | +// RUN: %clang -### -fsycl-instrument-device-code %s 2>&1 \ |
| 100 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-instrument-device-code %s |
| 101 | +// RUN: %clang_cl -### -fsycl-instrument-device-code %s 2>&1 \ |
| 102 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-instrument-device-code %s |
| 103 | + |
| 104 | +// Warning should be emitted when using -fsycl-libspirv-path without -fsycl |
| 105 | +// RUN: %clang -### -fsycl-libspirv-path=libspirv.bc %s 2>&1 \ |
| 106 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-libspirv-path=libspirv.bc %s |
| 107 | +// RUN: %clang_cl -### -fsycl-libspirv-path=libspirv.bc %s 2>&1 \ |
| 108 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-libspirv-path=libspirv.bc %s |
| 109 | + |
| 110 | +// Warning should be emitted when using -fsycl-max-parallel-link-jobs without -fyscl |
| 111 | +// RUN: %clang -### -fsycl-max-parallel-link-jobs=4 %s 2>&1 \ |
| 112 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-max-parallel-link-jobs=4 %s |
| 113 | +// RUN: %clang_cl -### -fsycl-max-parallel-link-jobs=4 %s 2>&1 \ |
| 114 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-max-parallel-link-jobs=4 %s |
| 115 | + |
| 116 | +// Warning should be emitted when using -fsycl-optimize-non-user-code without -fsycl |
| 117 | +// RUN: %clang -### -fsycl-optimize-non-user-code %s 2>&1 \ |
| 118 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-optimize-non-user-code %s |
| 119 | +// RUN: %clang_cl -### -fsycl-optimize-non-user-code %s 2>&1 \ |
| 120 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-optimize-non-user-code %s |
| 121 | + |
| 122 | +// Warning should be emitted when using -fsycl-unnamed-lambda without -fsycl |
| 123 | +// RUN: %clang -### -fsycl-unnamed-lambda %s 2>&1 \ |
| 124 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-unnamed-lambda %s |
| 125 | +// RUN: %clang_cl -### -fsycl-unnamed-lambda %s 2>&1 \ |
| 126 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-unnamed-lambda %s |
| 127 | + |
| 128 | +// Warning should be emitted when using -fsycl-use-bitcode without -fsycl |
| 129 | +// RUN: %clang -### -fsycl-use-bitcode %s 2>&1 \ |
| 130 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-use-bitcode %s |
| 131 | +// RUN: %clang_cl -### -fsycl-use-bitcode %s 2>&1 \ |
| 132 | +// RUN: | FileCheck -check-prefix=WARNING-UNUSED-ARG -DOPT=-fsycl-use-bitcode %s |
| 133 | + |
| 134 | +// WARNING-UNUSED-ARG: warning: argument unused during compilation: '[[OPT]]' [-Wunused-command-line-argument] |
0 commit comments