aboutsummaryrefslogtreecommitdiff
path: root/test/SemaOpenCL/queue_t_overload.cl
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaOpenCL/queue_t_overload.cl')
-rw-r--r--test/SemaOpenCL/queue_t_overload.cl12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaOpenCL/queue_t_overload.cl b/test/SemaOpenCL/queue_t_overload.cl
new file mode 100644
index 000000000000..0048895ac805
--- /dev/null
+++ b/test/SemaOpenCL/queue_t_overload.cl
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -cl-std=CL2.0 -verify -pedantic -fsyntax-only
+
+void __attribute__((overloadable)) foo(queue_t, __local char *); // expected-note {{candidate function not viable: no known conversion from 'int' to 'queue_t' for 1st argument}} // expected-note {{candidate function}}
+void __attribute__((overloadable)) foo(queue_t, __local float *); // expected-note {{candidate function not viable: no known conversion from 'int' to 'queue_t' for 1st argument}} // expected-note {{candidate function}}
+
+void kernel ker(__local char *src1, __local float *src2, __global int *src3) {
+ queue_t q;
+ foo(q, src1);
+ foo(0, src2);
+ foo(q, src3); // expected-error {{call to 'foo' is ambiguous}}
+ foo(1, src3); // expected-error {{no matching function for call to 'foo'}}
+}