1// RUN: %clang_cc1 -verify %s 2// RUN: %clang_cc1 -cl-std=CL2.0 -verify %s 3 4kernel void no_ptrptr(global int * global *i) { } // expected-error{{kernel parameter cannot be declared as a pointer to a pointer}} 5 6__kernel void no_privateptr(__private int *i) { } // expected-error {{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}} 7 8__kernel void no_privatearray(__private int i[]) { } // expected-error {{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}} 9 10kernel int bar() { // expected-error {{kernel must have void return type}} 11 return 6; 12} 13 14kernel void main() { // expected-error {{kernel cannot be called 'main'}} 15 16} 17 18int main() { // expected-error {{function cannot be called 'main'}} 19 return 0; 20} 21 22int* global x(int* x) { // expected-error {{return value cannot be qualified with address space}} 23 return x + 1; 24} 25 26int* local x(int* x) { // expected-error {{return value cannot be qualified with address space}} 27 return x + 1; 28} 29 30int* constant x(int* x) { // expected-error {{return value cannot be qualified with address space}} 31 return x + 1; 32} 33 34__kernel void testKernel(int *ptr) { // expected-error {{pointer arguments to kernel functions must reside in '__global', '__constant' or '__local' address space}} 35} 36