1 // { dg-additional-options "-mavx" { target avx_runtime } }
2 // { dg-do compile { target { avx_runtime || vect_sizes_16B_8B } } }
7 ushort8 v1
, v2
= 1, v3
= 1;
18 static assert(!__traits(compiles
, v1
~ v2
));
19 static assert(!__traits(compiles
, v1 ^^ v2
));
22 static assert( __traits(compiles
, v1
== v2
));
23 static assert( __traits(compiles
, v1
!= v2
));
24 static assert( __traits(compiles
, v1
< v2
));
25 static assert( __traits(compiles
, v1
> v2
));
26 static assert( __traits(compiles
, v1
<= v2
));
27 static assert( __traits(compiles
, v1
>= v2
));
31 static assert(!__traits(compiles
, v1
&& v2
));
32 static assert(!__traits(compiles
, v1 || v2
));
36 static assert(!__traits(compiles
, !v1
));
46 static assert(!__traits(compiles
, v1
~= v2
));
47 static assert(!__traits(compiles
, v1 ^^
= v2
));
52 // A cast from vector to non-vector is allowed only when the target is same size Tsarray.
53 static assert(!__traits(compiles
, cast(byte)v1
)); // 1byte
54 static assert(!__traits(compiles
, cast(short)v1
)); // 2byte
55 static assert(!__traits(compiles
, cast(int)v1
)); // 4byte
56 static assert(!__traits(compiles
, cast(long)v1
)); // 8byte
57 static assert(!__traits(compiles
, cast(float)v1
)); // 4byte
58 static assert(!__traits(compiles
, cast(double)v1
)); // 8byte
59 static assert(!__traits(compiles
, cast(int[2])v1
)); // 8byte Tsarray
60 static assert( __traits(compiles
, cast(int[4])v1
)); // 16byte Tsarray, OK
61 static assert( __traits(compiles
, cast(long[2])v1
)); // 16byte Tsarray, OK