Home | History | Annotate | Download | only in SemaOpenCL
      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