1 /* { dg-do compile } */
2 /* { dg-options "-Wall" } */
4 /* Origin: Aldy Hernandez <aldyh@redhat.com>. */
5 /* Purpose: Program to test generic SIMD support. */
7 typedef int __attribute__((vector_size (16))) v4si
;
8 typedef short __attribute__((vector_size (16))) v8hi
;
9 typedef int __attribute__((vector_size (8))) v2si
;
10 typedef unsigned int __attribute__((vector_size (16))) uv4si
;
19 short foo2
__attribute__((vector_size (8)));
27 /* Assignment of different types. */
28 b
= c
; /* { dg-error "incompatible types in assignment" } */
29 d
= a
; /* { dg-error "incompatible types in assignment" } */
31 /* Casting between SIMDs of the same size. */
34 /* Different signed SIMD assignment. */
37 /* Casted different signed SIMD assignment. */
40 /* Assignment between scalar and SIMD of different size. */
41 foo
= a
; /* { dg-error "incompatible types in assignment" } */
43 /* Casted assignment between scalar and SIMD of same size. */
44 foo
= (typeof (foo
)) foo2
;
46 /* Casted assignment between scalar and SIMD of different size. */
47 foo1
= (typeof (foo1
)) foo2
; /* { dg-error "can't convert between vector values of different size" } */
49 /* Operators on compatible SIMD types. */
56 /* Operators on incompatible SIMD types. */
57 a
= b
+ c
; /* { dg-error "invalid operands to binary +" } */
58 a
= b
- c
; /* { dg-error "invalid operands to binary -" } */
59 a
= b
* c
; /* { dg-error "invalid operands to binary *" } */
60 a
= b
/ c
; /* { dg-error "invalid operands to binary /" } */