xref: /llvm-project/clang/test/SemaOpenCL/unsupported.cl (revision 1881f648e28aa58aa0a4dca1422572f65dafa9a4)
1// RUN: %clang_cc1 -verify %s
2// RUN: %clang_cc1 -verify %s -DBITFIELDS_EXT -triple spir
3
4#ifdef BITFIELDS_EXT
5#pragma OPENCL EXTENSION __cl_clang_bitfields : enable
6#endif
7
8struct test {
9  int a : 1;
10#ifndef BITFIELDS_EXT
11// expected-error@-2 {{bit-fields are not supported in OpenCL}}
12#endif
13};
14
15void no_vla(int n) {
16  int a[n]; // expected-error {{variable length arrays are not supported in OpenCL}}
17}
18
19void no_logxor(int n) {
20  int logxor = n ^^ n; // expected-error {{^^ is a reserved operator in OpenCL}} \
21                          expected-error {{type name requires a specifier or qualifier}} \
22                          expected-error {{expected expression}}
23}
24