1 | // RUN: %clang_cc1 %s -cl-std=CL2.0 -verify -pedantic -fsyntax-only |
2 | extern queue_t get_default_queue(); |
3 | |
4 | void queue_arg(queue_t); // expected-note {{passing argument to parameter here}} |
5 | |
6 | void init() { |
7 | queue_t q1 = 1; // expected-error{{initializing 'queue_t' with an expression of incompatible type 'int'}} |
8 | queue_t q = 0; |
9 | } |
10 | |
11 | void assign() { |
12 | queue_t q2, q3; |
13 | q2 = 5; // expected-error{{assigning to 'queue_t' from incompatible type 'int'}} |
14 | q3 = 0; |
15 | q2 = q3 = 0; |
16 | } |
17 | |
18 | bool compare() { |
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 ('queue_t' and 'float')}} |
25 | } |
26 | |
27 | void call() { |
28 | queue_arg(5); // expected-error {{passing 'int' to parameter of incompatible type 'queue_t'}} |
29 | queue_arg(0); |
30 | } |
31 | |