llvm/clang/test/Parser/opencl-storage-class.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

16 lines
875 B
Common Lisp

// RUN: %clang_cc1 %s -cl-std=CL1.0 -verify -fsyntax-only -triple spir-unknown-unknown
void test_storage_class_specs()
{
static int a; // expected-error {{OpenCL C version 1.0 does not support the 'static' storage class specifier}}
register int b; // expected-error {{OpenCL C version 1.0 does not support the 'register' storage class specifier}}
extern int c; // expected-error {{OpenCL C version 1.0 does not support the 'extern' storage class specifier}}
auto int d; // expected-error {{OpenCL C version 1.0 does not support the 'auto' storage class specifier}}
#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
static int e; // expected-error {{static local variable must reside in constant address space}}
register int f;
extern int g; // expected-error {{extern variable must reside in constant address space}}
auto int h;
}