From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/SemaOpenCL/vector_conv_invalid.cl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 clang/test/SemaOpenCL/vector_conv_invalid.cl (limited to 'clang/test/SemaOpenCL/vector_conv_invalid.cl') diff --git a/clang/test/SemaOpenCL/vector_conv_invalid.cl b/clang/test/SemaOpenCL/vector_conv_invalid.cl new file mode 100644 index 0000000..e6ef5a4 --- /dev/null +++ b/clang/test/SemaOpenCL/vector_conv_invalid.cl @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -verify %s + +typedef unsigned int uint4 __attribute((ext_vector_type(4))); +typedef int int4 __attribute((ext_vector_type(4))); +typedef int int3 __attribute((ext_vector_type(3))); +typedef unsigned uint3 __attribute((ext_vector_type(3))); + +void vector_conv_invalid() { + uint4 u = (uint4)(1); + int4 i = u; // expected-error{{initializing 'int4' with an expression of incompatible type 'uint4'}} + int4 e = (int4)u; // expected-error{{invalid conversion between ext-vector type 'int4' and 'uint4'}} + + uint3 u4 = (uint3)u; // expected-error{{invalid conversion between ext-vector type 'uint3' and 'uint4'}} +} -- cgit v1.2.3