xref: /llvm-project/clang/test/SemaOpenCL/invalid-kernel.cl (revision 7e04c0ad632527df0a4c4d34a6ac6ec6a3888dfe)
1// RUN: %clang_cc1 -verify %s
2// RUN: %clang_cc1 -cl-std=CL2.0 -verify %s
3
4kernel int bar()  { // expected-error {{kernel must have void return type}}
5  return 6;
6}
7
8kernel void main() { // expected-error {{kernel cannot be called 'main'}}
9
10}
11
12int main() { // expected-error {{function cannot be called 'main'}}
13  return 0;
14}
15
16int* global x(int* x) { // expected-error {{return type cannot be qualified with address space}}
17  return x + 1;
18}
19
20int* local x(int* x) { // expected-error {{return type cannot be qualified with address space}}
21  return x + 1;
22}
23
24int* constant x(int* x) { // expected-error {{return type cannot be qualified with address space}}
25  return x + 1;
26}
27