1 /* { dg-do run } */ 2 /* { dg-options "-O1" } */ 3 4 typedef unsigned long V __attribute__ ((__vector_size__ (8))); 5 typedef _Complex int Ci; 6 typedef _Complex float Cf; 7 8 union U 9 { 10 Ci ci; 11 Cf cf; 12 }; 13 14 volatile Ci vgi; 15 foo(Cf c)16Cf foo (Cf c) 17 { 18 __real c = 0x1ffp10; 19 return c; 20 } 21 ioo(Ci c)22Ci ioo (Ci c) 23 { 24 __real c = 50; 25 return c; 26 } 27 28 main(int argc,char * argv[])29int main (int argc, char *argv[]) 30 { 31 union U u; 32 33 __real u.ci = 500; 34 __imag u.ci = 1000; 35 vgi = u.ci; 36 37 u.ci = ioo (u.ci); 38 __imag u.ci = 100; 39 40 if (__real u.ci != 50 || __imag u.ci != 100) 41 __builtin_abort(); 42 43 u.cf = foo (u.cf); 44 __imag u.cf = 0x1p3; 45 46 if (__real u.cf != 0x1ffp10 || __imag u.cf != 0x1p3) 47 __builtin_abort(); 48 49 return 0; 50 } 51