summaryrefslogtreecommitdiffstats
path: root/test/SemaOpenCL/sampler_t.cl
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaOpenCL/sampler_t.cl')
-rw-r--r--test/SemaOpenCL/sampler_t.cl13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaOpenCL/sampler_t.cl b/test/SemaOpenCL/sampler_t.cl
new file mode 100644
index 0000000..96f6dbf
--- /dev/null
+++ b/test/SemaOpenCL/sampler_t.cl
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+
+constant sampler_t glb_smp = 5;
+
+void foo(sampler_t);
+
+void kernel ker(sampler_t argsmp) {
+ local sampler_t smp; // expected-error {{sampler type cannot be used with the __local and __global address space qualifiers}}
+ const sampler_t const_smp = 7;
+ foo(glb_smp);
+ foo(const_smp);
+ foo(5); // expected-error {{sampler_t variable required - got 'int'}}
+}
OpenPOWER on IntegriCloud