llvm-project
15 строк · 875.0 Байт
1// RUN: %clang_cc1 %s -cl-std=CL1.0 -verify -fsyntax-only -triple spir-unknown-unknown
2
3void test_storage_class_specs()
4{
5static int a; // expected-error {{OpenCL C version 1.0 does not support the 'static' storage class specifier}}
6register int b; // expected-error {{OpenCL C version 1.0 does not support the 'register' storage class specifier}}
7extern int c; // expected-error {{OpenCL C version 1.0 does not support the 'extern' storage class specifier}}
8auto int d; // expected-error {{OpenCL C version 1.0 does not support the 'auto' storage class specifier}}
9
10#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
11static int e; // expected-error {{static local variable must reside in constant address space}}
12register int f;
13extern int g; // expected-error {{extern variable must reside in constant address space}}
14auto int h;
15}
16