[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / SemaOpenCL / null_queue.cl
bloba74082f77285bf53a561589288c6dfdc3cd2931a
1 // RUN: %clang_cc1 %s -cl-std=CL2.0 -verify -pedantic -fsyntax-only
2 extern queue_t get_default_queue(void);
4 void queue_arg(queue_t); // expected-note {{passing argument to parameter here}}
6 void init(void) {
7 queue_t q1 = 1; // expected-error{{initializing '__private queue_t' with an expression of incompatible type 'int'}}
8 queue_t q = 0;
11 void assign(void) {
12 queue_t q2, q3;
13 q2 = 5; // expected-error{{assigning to '__private queue_t' from incompatible type 'int'}}
14 q3 = 0;
15 q2 = q3 = 0;
18 bool compare(void) {
19 queue_t q4, q5;
20 return 1 == get_default_queue() && // expected-error{{invalid operands to binary expression ('int' and 'queue_t')}}
21 get_default_queue() == 1 && // expected-error{{invalid operands to binary expression ('queue_t' and 'int')}}
22 q4 == q5 &&
23 q4 != 0 &&
24 q4 != 0.0f; // expected-error{{invalid operands to binary expression ('__private queue_t' and 'float')}}
27 void call(void) {
28 queue_arg(5); // expected-error {{passing 'int' to parameter of incompatible type 'queue_t'}}
29 queue_arg(0);