blob: 90cec26a605a4ede20b2d1823ece1fe4c6c63cba [file] [log] [blame]
Tobias Grosser766bcc22011-09-22 13:03:14 +00001// RUN: %clang_cc1 -verify %s
2
3typedef unsigned int uint4 __attribute((ext_vector_type(4)));
4typedef int int4 __attribute((ext_vector_type(4)));
5typedef int int3 __attribute((ext_vector_type(3)));
6typedef unsigned uint3 __attribute((ext_vector_type(3)));
7
8void vector_conv_invalid() {
9 uint4 u = (uint4)(1);
Benjamin Kramer1adc8c32014-04-25 20:41:38 +000010 int4 i = u; // expected-error{{initializing 'int4' (vector of 4 'int' values) with an expression of incompatible type 'uint4' (vector of 4 'unsigned int' values)}}
11 int4 e = (int4)u; // expected-error{{invalid conversion between ext-vector type 'int4' (vector of 4 'int' values) and 'uint4' (vector of 4 'unsigned int' values)}}
Tobias Grosser766bcc22011-09-22 13:03:14 +000012
Benjamin Kramer1adc8c32014-04-25 20:41:38 +000013 uint3 u4 = (uint3)u; // expected-error{{invalid conversion between ext-vector type 'uint3' (vector of 3 'unsigned int' values) and 'uint4' (vector of 4 'unsigned int' values)}}
Tobias Grosser766bcc22011-09-22 13:03:14 +000014}