1 | // RUN: %clang_cc1 -verify %s |
2 | // RUN: %clang_cc1 -cl-std=CL2.0 -verify %s |
3 | |
4 | kernel 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 | |
10 | kernel int bar() { // expected-error {{kernel must have void return type}} |
11 | return 6; |
12 | } |
13 | |
14 | kernel void main() { // expected-error {{kernel cannot be called 'main'}} |
15 | |
16 | } |
17 | |
18 | int main() { // expected-error {{function cannot be called 'main'}} |
19 | return 0; |
20 | } |
21 | |
22 | int* global x(int* x) { // expected-error {{return value cannot be qualified with address space}} |
23 | return x + 1; |
24 | } |
25 | |
26 | int* local x(int* x) { // expected-error {{return value cannot be qualified with address space}} |
27 | return x + 1; |
28 | } |
29 | |
30 | int* 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 | |