aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaOpenCL/amdgpu-image-rsrc.cl
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaOpenCL/amdgpu-image-rsrc.cl')
-rw-r--r--clang/test/SemaOpenCL/amdgpu-image-rsrc.cl13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaOpenCL/amdgpu-image-rsrc.cl b/clang/test/SemaOpenCL/amdgpu-image-rsrc.cl
new file mode 100644
index 0000000..dc56494
--- /dev/null
+++ b/clang/test/SemaOpenCL/amdgpu-image-rsrc.cl
@@ -0,0 +1,13 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
+// REQUIRES: amdgpu-registered-target
+// RUN: %clang_cc1 -verify -cl-std=CL1.2 -triple amdgcn-amd-amdhsa %s
+// RUN: %clang_cc1 -verify -cl-std=CL2.0 -triple amdgcn-amd-amdhsa %s
+
+void f() {
+ int n = 3;
+ __amdgpu_texture_t v = (__amdgpu_texture_t)0; // expected-error {{used type '__amdgpu_texture_t' where arithmetic or pointer type is required}}
+ int k = v; // expected-error {{initializing '__private int' with an expression of incompatible type '__private __amdgpu_texture_t'}}
+ (void)(v + v); // expected-error {{invalid operands}}
+ __amdgpu_texture_t r;
+ int *p = (int*)r; // expected-error {{operand of type '__amdgpu_texture_t' where arithmetic or pointer type is required}}
+}