36 lines · plain
1// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.22// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=-all3// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++2021 -cl-ext=-all4 5void foo(read_only pipe int p);6#if __OPENCL_C_VERSION__ > 1207// expected-error@-2 {{OpenCL C version 3.0 does not support the 'pipe' type qualifier}}8// expected-error@-3 {{access qualifier can only be used for pipe and image type}}9#elif defined(__OPENCL_CPP_VERSION__)10// expected-error@-5 {{C++ for OpenCL version 2021 does not support the 'pipe' type qualifier}}11// expected-error@-6 {{access qualifier can only be used for pipe and image type}}12#else13// expected-error@-8 {{type specifier missing, defaults to 'int'}}14// expected-error@-9 {{access qualifier can only be used for pipe and image type}}15// expected-error@-10 {{expected ')'}} expected-note@-10 {{to match this '('}}16#endif17 18// 'pipe' should be accepted as an identifier.19typedef int pipe;20#if __OPENCL_C_VERSION__ > 12021// expected-error@-2 {{OpenCL C version 3.0 does not support the 'pipe' type qualifier}}22// expected-warning@-3 {{typedef requires a name}}23#elif defined(__OPENCL_CPP_VERSION__)24// expected-error@-5 {{C++ for OpenCL version 2021 does not support the 'pipe' type qualifier}}25// expected-warning@-6 {{typedef requires a name}}26#endif27 28void bar(void) {29 reserve_id_t r;30#if defined(__OPENCL_C_VERSION__)31// expected-error@-2 {{use of undeclared identifier 'reserve_id_t'}}32#else33// expected-error@-4 {{unknown type name 'reserve_id_t'}}34#endif35}36