1 | // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 |
2 | |
3 | // Taken from opencl-c.h |
4 | #define CLK_NULL_EVENT (__builtin_astype(((void*)(__SIZE_MAX__)), clk_event_t)) |
5 | |
6 | global clk_event_t ce; // expected-error {{the '__global clk_event_t' type cannot be used to declare a program scope variable}} |
7 | |
8 | int clk_event_tests() { |
9 | event_t e; |
10 | clk_event_t ce1; |
11 | clk_event_t ce2; |
12 | |
13 | if (e == ce1) { // expected-error {{invalid operands to binary expression ('event_t' and 'clk_event_t')}} |
14 | return 9; |
15 | } |
16 | |
17 | if (ce1 != ce2) { |
18 | return 1; |
19 | } |
20 | else if (ce1 == CLK_NULL_EVENT || ce2 != CLK_NULL_EVENT) { |
21 | return 0; |
22 | } |
23 | |
24 | return 2; |
25 | } |
26 | |