Peter Collingbourne | 63cf68a | 2011-11-08 02:52:58 +0000 | [diff] [blame] | 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 | } |