2015-09-24 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr58041.c
blob169a71ae7e454f0094fbc0420d069bf9b06d53be
1 /* { dg-do run } */
3 typedef long long V
4 __attribute__ ((vector_size (2 * sizeof (long long)), may_alias));
6 struct s
8 char u;
9 V v[2];
10 } __attribute__((packed,aligned(1)));
12 __attribute__((noinline, noclone))
13 long long foo(struct s *x, int y, V *z)
15 V a = x->v[y];
16 x->v[y] = *z;
17 return a[1];
20 struct s a = {0,{{0,0},{0,0}}};
21 int main()
23 V v1 = {0,1};
24 V v2 = {0,2};
26 if (foo(&a,0,&v1) != 0)
27 __builtin_abort();
28 if (foo(&a,0,&v2) != 1)
29 __builtin_abort();
30 if (foo(&a,1,&v1) != 0)
31 __builtin_abort();
32 return 0;