blob: 6ab10b3507f746e4e69ac02986504c8ebb9a08fa [file] [log] [blame]
Peter Collingbourne63cf68a2011-11-08 02:52:58 +00001// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
2
3__constant int ci = 1;
4
5__kernel void foo(__global int *gip) {
6 __local int li;
7 __local int lj = 2; // expected-error {{'__local' variable cannot have an initializer}}
8
9 int *ip;
10 ip = gip; // expected-error {{assigning '__global int *' to 'int *' changes address space of pointer}}
11 ip = &li; // expected-error {{assigning '__local int *' to 'int *' changes address space of pointer}}
12 ip = &ci; // expected-error {{assigning '__constant int *' to 'int *' changes address space of pointer}}
13}