Index: test/SemaOpenCL/atomic-ptr.cl =================================================================== --- /dev/null +++ test/SemaOpenCL/atomic-ptr.cl @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -O0 -cl-std=CL2.0 -fsyntax-only -verify %s +// expected-no-diagnostics + +void __kernel test_atomic_ptrs(void){ + // Null assignment to atomic pointer is legal + local atomic_int *p1 = 0; + + // Array aliasing is permitted + local atomic_int a[16]; + local atomic_int *p2 = a; + + // Test pointer arithmetics + local atomic_int *p3 = p1 + 1; + + // Test implicit cast to pointer + local atomic_int *p4 = a + 1; +}