Fznamznon created this revision. Herald added subscribers: cfe-commits, Anastasia, yaxunl.
Repository: rC Clang https://reviews.llvm.org/D42844 Files: test/SemaOpenCL/atomic-ptr.cl 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; +}
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; +}
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits