1 /* PR regression/21897 */ 2 3 extern void abort (void); 4 5 typedef short v4hi __attribute__ ((vector_size (8))); 6 typedef float v4sf __attribute__ ((vector_size (16))); 7 8 union 9 { 10 v4hi v; 11 short s[4]; 12 } u; 13 14 union 15 { 16 v4sf v; 17 float f[4]; 18 } v; 19 20 void foo(void)21foo (void) 22 { 23 unsigned int i; 24 for (i = 0; i < 2; i++) 25 u.v += (v4hi) { 12, 14 }; 26 for (i = 0; i < 2; i++) 27 v.v += (v4sf) { 18.0, 20.0, 22 }; 28 } 29 30 int main(void)31main (void) 32 { 33 foo (); 34 if (u.s[0] != 24 || u.s[1] != 28 || u.s[2] || u.s[3]) 35 abort (); 36 if (v.f[0] != 36.0 || v.f[1] != 40.0 || v.f[2] != 44.0 || v.f[3] != 0.0) 37 abort (); 38 return 0; 39 } 40