libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr103744-2.c
blob52307abf2462d6aef2409e64f024dc1083a3db16
1 /* { dg-do compile } */
3 int
4 f1 (int *restrict x, unsigned short *restrict y)
6 int res = 0;
7 for (int i = 0; i < 100; i += 2)
9 unsigned short i1 = y[i + 0] + 1;
10 unsigned short i2 = y[i + 1] + 2;
11 res += x[i1];
12 res += x[i2];
14 return res;
17 void
18 f2 (int *restrict x, unsigned short *restrict y)
20 int res1 = 0;
21 int res2 = 0;
22 for (int i = 0; i < 100; i += 2)
24 unsigned short i1 = y[i + 0] + 1;
25 unsigned short i2 = y[i + 1] + 2;
26 res1 += x[i1];
27 res2 += x[i2];
29 x[0] = res1;
30 x[1] = res2;