|
| 1 | +// RUN: %clang_cc1 -isystem %S/Inputs/ -fsycl-is-device -triple spirv64 -aux-triple x86_64-pc-windows-msvc -fsyntax-only -verify %s |
| 2 | +// RUN: %clang_cc1 -isystem %S/Inputs/ -fsycl-is-device -triple spirv64 -fsyntax-only -verify %s |
| 3 | + |
| 4 | +template<typename KN, typename...Args> |
| 5 | +void sycl_kernel_launch(Args ...args) {} |
| 6 | + |
| 7 | +template<typename KN, typename K> |
| 8 | +[[clang::sycl_kernel_entry_point(KN)]] |
| 9 | +void sycl_entry_point(K k) { |
| 10 | + k(); // expected-note 2{{called by}} |
| 11 | +} |
| 12 | + |
| 13 | +void variadic(int, ...) {} |
| 14 | +namespace NS { |
| 15 | +void variadic(int, ...) {} |
| 16 | +} |
| 17 | + |
| 18 | +struct S { |
| 19 | + S(int, ...) {} |
| 20 | + void operator()(int, ...) {} |
| 21 | +}; |
| 22 | + |
| 23 | +void foo() { |
| 24 | + auto x = [](int, ...) {}; |
| 25 | + x(5, 10); //expected-error{{SYCL device code does not support variadic functions}} |
| 26 | +} |
| 27 | + |
| 28 | +void overloaded(int, int) {} |
| 29 | +void overloaded(int, ...) {} |
| 30 | + |
| 31 | +int main() { |
| 32 | + sycl_entry_point<class FK>([]() { |
| 33 | + variadic(5); //expected-error{{SYCL device code does not support variadic functions}} |
| 34 | + variadic(5, 2); //expected-error{{SYCL device code does not support variadic functions}} |
| 35 | + NS::variadic(5, 3); //expected-error{{SYCL device code does not support variadic functions}} |
| 36 | + S s(5, 4); //expected-error{{SYCL device code does not support variadic functions}} |
| 37 | + S s2(5); //expected-error{{SYCL device code does not support variadic functions}} |
| 38 | + s(5, 5); //expected-error{{SYCL device code does not support variadic functions}} |
| 39 | + s2(5); //expected-error{{SYCL device code does not support variadic functions}} |
| 40 | + foo(); //expected-note{{called by 'operator()'}} |
| 41 | + overloaded(5, 6); //expected-no-error |
| 42 | + overloaded(5, s); //expected-error{{SYCL device code does not support variadic functions}} |
| 43 | + overloaded(5); //expected-error{{SYCL device code does not support variadic functions}} |
| 44 | + }); |
| 45 | +} |
0 commit comments