From bab175ec4b075c8076ba14c762900392533f6ee4 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 2 Jan 2017 19:18:08 +0000 Subject: Vendor import of clang trunk r290819: https://llvm.org/svn/llvm-project/cfe/trunk@290819 --- test/SemaOpenCL/null_queue.cl | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/SemaOpenCL/null_queue.cl (limited to 'test/SemaOpenCL/null_queue.cl') diff --git a/test/SemaOpenCL/null_queue.cl b/test/SemaOpenCL/null_queue.cl new file mode 100644 index 000000000000..518f7138de6c --- /dev/null +++ b/test/SemaOpenCL/null_queue.cl @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 %s -cl-std=CL2.0 -verify -pedantic -fsyntax-only +extern queue_t get_default_queue(); + +bool compare() { + return 1 == get_default_queue() && // expected-error{{invalid operands to binary expression ('int' and 'queue_t')}} + get_default_queue() == 1; // expected-error{{invalid operands to binary expression ('queue_t' and 'int')}} +} + +void init() { + queue_t q1 = 1; // expected-error{{initializing 'queue_t' with an expression of incompatible type 'int'}} + queue_t q = 0; +} -- cgit v1.3