1 /* { dg-do run } */ 2 /* { dg-options "-O2 -w" } */ 3 /* { dg-skip-if "TImode not supported" { "avr-*-*" } { "*" } { "" } } */ 4 5 extern void abort (void); 6 7 #if(__SIZEOF_INT__ >= 4) 8 typedef int __m128i __attribute__ ((__vector_size__ (16))); 9 #else 10 typedef long __m128i __attribute__ ((__vector_size__ (16))); 11 #endif 12 __m128i foo(void)13foo (void) 14 { 15 __m128i x = { 0x11111111, 0x22222222, 0x44444444 }; 16 return x; 17 } 18 19 __m128i bar(void)20bar (void) 21 { 22 __m128i x = { 0x11111111, 0x22222222, 0x44444444 }; 23 return ~x; 24 } 25 26 int main(void)27main (void) 28 { 29 #if(__SIZEOF_INT__ >= 4) 30 union { __m128i v; int i[sizeof (__m128i) / sizeof (int)]; } u, v; 31 #else 32 union { __m128i v; long i[sizeof (__m128i) / sizeof (long)]; } u, v; 33 #endif 34 int i; 35 36 u.v = foo (); 37 v.v = bar (); 38 for (i = 0; i < sizeof (u.i) / sizeof (u.i[0]); i++) 39 { 40 if (u.i[i] != ~v.i[i]) 41 abort (); 42 if (i < 3) 43 { 44 if (u.i[i] != (0x11111111 << i)) 45 abort (); 46 } 47 else if (u.i[i]) 48 abort (); 49 } 50 return 0; 51 } 52