1 /* { dg-do run } */ 2 /* { dg-options "-O2" } */ 3 4 #include "v2si.c" 5 6 void __attribute__((noinline, noclone)) init_val(__v2si * p)7init_val ( __v2si *p) 8 { 9 char *p2 = (char*)p; 10 p2[0] = 8; 11 p2[1] = 7; 12 p2[2] = 6; 13 p2[3] = 5; 14 p2[4] = 4; 15 p2[5] = 3; 16 p2[6] = 2; 17 p2[7] = 1; 18 } 19 20 int main(void)21main (void) 22 { 23 { 24 __v2si val; 25 __v2si val2; 26 __v2si val3; 27 28 init_val(&val); 29 30 /* Copy val to val2. */ 31 vector_store (&val2, val); 32 33 /* Copy val2 to val3. */ 34 val3 = vector_load (&val2); 35 36 /* Compare val to val3. */ 37 { 38 char *p = (char*)&val; 39 char *p2 = (char*)&val3; 40 41 if (p[0] != p2[0]) 42 return 1; 43 if (p[1] != p2[1]) 44 return 1; 45 if (p[2] != p2[2]) 46 return 1; 47 if (p[3] != p2[3]) 48 return 1; 49 if (p[4] != p2[4]) 50 return 1; 51 if (p[5] != p2[5]) 52 return 1; 53 if (p[6] != p2[6]) 54 return 1; 55 if (p[7] != p2[7]) 56 return 1; 57 } 58 } 59 60 { 61 __v2si val4 = vector_const (); 62 char *p = (char*)&val4; 63 64 if (p[0] != 1) 65 return 1; 66 if (p[1] != 0) 67 return 1; 68 if (p[2] != 0) 69 return 1; 70 if (p[3] != 0) 71 return 1; 72 if (p[4] != 2) 73 return 1; 74 if (p[5] != 0) 75 return 1; 76 if (p[6] != 0) 77 return 1; 78 if (p[7] != 0) 79 return 1; 80 } 81 82 return 0; 83 } 84