llvm-project/clang/test/Parser/opencl-cl20.cl
Anastasia Stulova 81600160b3 [OpenCL] Change default standard version to CL1.2
Set default version for OpenCL C to 1.2. This means that the
absence of any standard flag will be equivalent to passing
'-cl-std=CL1.2'.

Note that this patch also fixes incorrect version check for
the pointer to pointer kernel arguments diagnostic and
atomic test.

Differential Revision: https://reviews.llvm.org/D106504
2021-07-26 15:04:34 +01:00

27 lines
1.0 KiB
Common Lisp

// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0
#if __OPENCL_C_VERSION__ == CL_VERSION_2_0
// expected-no-diagnostics
#endif
__generic int * __generic_test(__generic int *arg) {
__generic int *var;
return var;
}
#if __OPENCL_C_VERSION__ != CL_VERSION_2_0
// expected-error@-5 {{OpenCL C version 1.2 does not support the '__generic' type qualifier}}
// expected-error@-6 {{OpenCL C version 1.2 does not support the '__generic' type qualifier}}
// expected-error@-6 {{OpenCL C version 1.2 does not support the '__generic' type qualifier}}
#endif
generic int * generic_test(generic int *arg) {
generic int *var;
return var;
}
#if __OPENCL_C_VERSION__ != CL_VERSION_2_0
// expected-error@-5 {{OpenCL C version 1.2 does not support the 'generic' type qualifier}}
// expected-error@-6 {{OpenCL C version 1.2 does not support the 'generic' type qualifier}}
// expected-error@-6 {{OpenCL C version 1.2 does not support the 'generic' type qualifier}}
#endif