11// RUN: %{build} -o %t.out
22// RUN: %{run} %t.out
33//
4+ // RUN: %{build} -DTEST_ERRORS -D_GLIBCXX_USE_CXX11_ABI=0 -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note
45
56// ==--- backend_info.cpp - SYCL backend info test---------------------------==//
67//
1718using namespace sycl ;
1819
1920int main () {
21+ #if (defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI != 0) || \
22+ !defined (_GLIBCXX_USE_CXX11_ABI) || TEST_ERRORS
2023 try {
2124 // Test get_backend_info for sycl::platform
2225 std::vector<platform> platform_list = platform::get_platforms ();
2326 for (const auto &platform : platform_list) {
27+ // expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
28+ // expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::device::version, $1 = (no value)]}}
2429 std::cout << " Backend device version: "
2530 << platform.get_backend_info <info::device::version>()
2631 << std::endl;
32+ // expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
33+ // expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::platform::version, $1 = (no value)]}}
2734 std::cout << " Backend platform version: "
2835 << platform.get_backend_info <info::platform::version>()
2936 << std::endl;
@@ -33,32 +40,48 @@ int main() {
3340 std::vector<device> device_list =
3441 device::get_devices (info::device_type::gpu);
3542 for (const auto &device : device_list) {
43+ // expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
44+ // expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::device::version, $1 = (no value)]}}
3645 std::cout << " Backend device version: "
3746 << device.get_backend_info <info::device::version>()
3847 << std::endl;
48+ // expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
49+ // expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::platform::version, $1 = (no value)]}}
3950 std::cout << " Backend platform version: "
4051 << device.get_backend_info <info::platform::version>()
4152 << std::endl;
4253 }
4354
4455 // Test get_backend_info for sycl::queue
4556 queue q;
57+ // expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
58+ // expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::device::version, $1 = (no value)]}}
4659 std::cout << " Backend device version: "
4760 << q.get_backend_info <info::device::version>() << std::endl;
61+ // expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
62+ // expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::platform::version, $1 = (no value)]}}
4863 std::cout << " Backend platform version: "
4964 << q.get_backend_info <info::platform::version>() << std::endl;
5065
5166 // Test get_backend_info for sycl::context
5267 context Ctx = q.get_context ();
68+ // expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
69+ // expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::device::version, $1 = (no value)]}}
5370 std::cout << " Backend device version: "
5471 << Ctx.get_backend_info <info::device::version>() << std::endl;
72+ // expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
73+ // expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::platform::version, $1 = (no value)]}}
5574 std::cout << " Backend platform version: "
5675 << Ctx.get_backend_info <info::platform::version>() << std::endl;
5776
5877 // Test get_backend_info for sycl::event
5978 event e = q.single_task ([=]() { return ; });
79+ // expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
80+ // expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::device::version, $1 = (no value)]}}
6081 std::cout << " Backend device version: "
6182 << e.get_backend_info <info::device::version>() << std::endl;
83+ // expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
84+ // expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::platform::version, $1 = (no value)]}}
6285 std::cout << " Backend platform version: "
6386 << e.get_backend_info <info::platform::version>() << std::endl;
6487
@@ -73,8 +96,12 @@ int main() {
7396 auto acc = buf.get_access <access::mode::read_write>(cgh);
7497 cgh.single_task <class SingleTask >(krn, [=]() { acc[0 ] = acc[0 ] + 1 ; });
7598 });
99+ // expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
100+ // expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::device::version, $1 = (no value)]}}
76101 std::cout << " Backend device version: "
77102 << krn.get_backend_info <info::device::version>() << std::endl;
103+ // expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
104+ // expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::platform::version, $1 = (no value)]}}
78105 std::cout << " Backend platform version: "
79106 << krn.get_backend_info <info::platform::version>() << std::endl;
80107 } catch (exception e) {
@@ -93,5 +120,6 @@ int main() {
93120 assert (has_non_opencl_backend && " unexpected error code" );
94121 }
95122 std::cout << " Backend info query tests passed" << std::endl;
123+ #endif
96124 return 0 ;
97125}
0 commit comments