Skip to content

Commit c0010e0

Browse files
authored
[SYCL][E2E] Add test demonstrating problems with std::array in device code on Windows (#18426)
This PR is meant to accompany #18400: It demonstrates that we currently have compile issues with MSVC when using `std::array` in device code on windows.
1 parent 7d85c72 commit c0010e0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

sycl/test-e2e/Basic/std_array.cpp

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// REQUIRES: windows
2+
3+
// RUN: not clang-cl -fsycl -o %t.exe %s /Od /MDd /Zi /EHsc 2>&1 | FileCheck %s
4+
5+
// FIXME: This code should have compiled cleanly.
6+
// CHECK: error: SYCL kernel cannot call an undefined function without SYCL_EXTERNAL attribute
7+
// CHECK: note: '_invalid_parameter' declared here
8+
9+
#include <sycl/queue.hpp>
10+
11+
int main() {
12+
sycl::queue q;
13+
14+
q.single_task([=]() {
15+
std::array<int, 5> arr = {1, 2, 0, 4, 5};
16+
arr[2] = 3;
17+
});
18+
19+
return 0;
20+
}

0 commit comments

Comments
 (0)