blob: 34d1a621f4a866b76d561ac61aa0d7fbea5ae09e [file] [log] [blame]
Egor Churaev89831422016-12-23 14:55:49 +00001// RUN: %clang_cc1 %s -cl-std=CL2.0 -verify -pedantic -fsyntax-only
2extern queue_t get_default_queue();
3
Sven van Haastregt0ea28c02018-09-25 12:59:34 +00004void queue_arg(queue_t); // expected-note {{passing argument to parameter here}}
Egor Churaev89831422016-12-23 14:55:49 +00005
6void init() {
7 queue_t q1 = 1; // expected-error{{initializing 'queue_t' with an expression of incompatible type 'int'}}
8 queue_t q = 0;
9}
Sven van Haastregt0ea28c02018-09-25 12:59:34 +000010
11void 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
18bool 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
27void call() {
28 queue_arg(5); // expected-error {{passing 'int' to parameter of incompatible type 'queue_t'}}
29 queue_arg(0);
30}