1
1
// RUN: %{build} -o %t.out
2
2
// RUN: %{run} %t.out
3
3
//
4
+ // RUN: %{build} -DTEST_ERRORS -D_GLIBCXX_USE_CXX11_ABI=0 -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note
4
5
5
6
// ==--- backend_info.cpp - SYCL backend info test---------------------------==//
6
7
//
17
18
using namespace sycl ;
18
19
19
20
int main () {
21
+ #if (defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI != 0) || \
22
+ !defined (_GLIBCXX_USE_CXX11_ABI) || TEST_ERRORS
20
23
try {
21
24
// Test get_backend_info for sycl::platform
22
25
std::vector<platform> platform_list = platform::get_platforms ();
23
26
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)]}}
24
29
std::cout << " Backend device version: "
25
30
<< platform.get_backend_info <info::device::version>()
26
31
<< 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)]}}
27
34
std::cout << " Backend platform version: "
28
35
<< platform.get_backend_info <info::platform::version>()
29
36
<< std::endl;
@@ -33,32 +40,48 @@ int main() {
33
40
std::vector<device> device_list =
34
41
device::get_devices (info::device_type::gpu);
35
42
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)]}}
36
45
std::cout << " Backend device version: "
37
46
<< device.get_backend_info <info::device::version>()
38
47
<< 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)]}}
39
50
std::cout << " Backend platform version: "
40
51
<< device.get_backend_info <info::platform::version>()
41
52
<< std::endl;
42
53
}
43
54
44
55
// Test get_backend_info for sycl::queue
45
56
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)]}}
46
59
std::cout << " Backend device version: "
47
60
<< 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)]}}
48
63
std::cout << " Backend platform version: "
49
64
<< q.get_backend_info <info::platform::version>() << std::endl;
50
65
51
66
// Test get_backend_info for sycl::context
52
67
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)]}}
53
70
std::cout << " Backend device version: "
54
71
<< 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)]}}
55
74
std::cout << " Backend platform version: "
56
75
<< Ctx.get_backend_info <info::platform::version>() << std::endl;
57
76
58
77
// Test get_backend_info for sycl::event
59
78
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)]}}
60
81
std::cout << " Backend device version: "
61
82
<< 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)]}}
62
85
std::cout << " Backend platform version: "
63
86
<< e.get_backend_info <info::platform::version>() << std::endl;
64
87
@@ -73,8 +96,12 @@ int main() {
73
96
auto acc = buf.get_access <access::mode::read_write>(cgh);
74
97
cgh.single_task <class SingleTask >(krn, [=]() { acc[0 ] = acc[0 ] + 1 ; });
75
98
});
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)]}}
76
101
std::cout << " Backend device version: "
77
102
<< 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)]}}
78
105
std::cout << " Backend platform version: "
79
106
<< krn.get_backend_info <info::platform::version>() << std::endl;
80
107
} catch (exception e) {
@@ -93,5 +120,6 @@ int main() {
93
120
assert (has_non_opencl_backend && " unexpected error code" );
94
121
}
95
122
std::cout << " Backend info query tests passed" << std::endl;
123
+ #endif
96
124
return 0 ;
97
125
}
0 commit comments