1// 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}
14