PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / fold-cvect.c
blob8687f8db2ad92e48085b3dfa2cd334303c7c26cc
1 /* { dg-do run } */
2 /* { dg-options "-O" } */
4 extern void abort (void);
6 /* We should fold all reads from xconstant and eliminate it, removing
7 the reference to blah which cannot be resolved at link time. */
8 extern int blah;
10 typedef int v4si __attribute__((vector_size(16)));
12 static const struct {
13 int *y;
14 const v4si x[2] __attribute__((aligned(32)));
15 } xconstant = { &blah, { { 0, 1, 2, 3 }, { 2, 3, 4, 5 } } };
17 int main()
19 if (sizeof (int) != 4)
20 return 0;
21 if (*(int *)&xconstant.x[0][0] != 0)
22 abort ();
23 if (*(int *)&xconstant.x[0][1] != 1)
24 abort ();
25 if (*(int *)&xconstant.x[0][2] != 2)
26 abort ();
27 if (*(int *)&xconstant.x[0][3] != 3)
28 abort ();
29 if (*(int *)&xconstant.x[1][0] != 2)
30 abort ();
31 if (*(int *)&xconstant.x[1][1] != 3)
32 abort ();
33 if (*(int *)&xconstant.x[1][2] != 4)
34 abort ();
35 if (*(int *)&xconstant.x[1][3] != 5)
36 abort ();
37 return 0;