| 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 |
|
| 8 |
struct test { |
| 9 |
int a : 1; |
| 10 |
#ifndef BITFIELDS_EXT |
| 11 |
// expected-error@-2 {{bit-fields are not supported in OpenCL}} |
| 12 |
#endif |
| 13 |
}; |
| 14 |
|
| 15 |
void no_vla(int n) { |
| 16 |
int a[n]; // expected-error {{variable length arrays are not supported in OpenCL}} |
| 17 |
} |
| 18 |
|
| 19 |
void 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 |
} |