xref: /aosp_15_r20/external/clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0
2*67e74705SXin Li
3*67e74705SXin Livoid test1(pipe int *p) {// expected-error {{pipes packet types cannot be of reference type}}
4*67e74705SXin Li}
5*67e74705SXin Livoid test2(pipe p) {// expected-error {{missing actual type specifier for pipe}}
6*67e74705SXin Li}
7*67e74705SXin Livoid test3(int pipe p) {// expected-error {{cannot combine with previous 'int' declaration specifier}}
8*67e74705SXin Li}
9*67e74705SXin Livoid test4() {
10*67e74705SXin Li  pipe int p; // expected-error {{type 'pipe int' can only be used as a function parameter}}
11*67e74705SXin Li  //TODO: fix parsing of this pipe int (*p);
12*67e74705SXin Li}
13*67e74705SXin Li
14*67e74705SXin Livoid test5(pipe int p) {
15*67e74705SXin Li  p+p; // expected-error{{invalid operands to binary expression ('pipe int' and 'pipe int')}}
16*67e74705SXin Li  p=p; // expected-error{{invalid operands to binary expression ('pipe int' and 'pipe int')}}
17*67e74705SXin Li  &p; // expected-error{{invalid argument type 'pipe int' to unary expression}}
18*67e74705SXin Li  *p; // expected-error{{invalid argument type 'pipe int' to unary expression}}
19*67e74705SXin Li}
20*67e74705SXin Li
21*67e74705SXin Litypedef pipe int pipe_int_t;
22*67e74705SXin Lipipe_int_t test6() {} // expected-error{{declaring function return value of type 'pipe_int_t' (aka 'pipe int') is not allowed}}
23