libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-epilogues-2.c
blob63c5e231f85b106111a1637a2c0e7b82bbc17c56
1 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
2 /* { dg-do compile } */
4 int
5 f1 (int *x, int n)
7 int res = 0;
8 for (int i = 0; i < n; ++i)
9 res += x[i * 2] == 1 ? 2 : 3;
10 return res;
13 int
14 f2 (int *x)
16 int res = 0;
17 for (int i = 0; i < 0x83; ++i)
18 res += x[i * 2] == 1 ? 2 : 3;
19 return res;
22 int
23 f3 (int *x, int n)
25 int res = 0;
26 for (int i = 0; i < n; ++i)
27 res += x[i * 2] == 1 ? 2 : 3;
28 return res + x[0x100];
31 int
32 f4 (int *x)
34 int res = 0;
35 for (int i = 0; i < 0x83; ++i)
36 res += x[i * 2] == 1 ? 2 : 3;
37 return res + x[0x100];
40 int
41 f5 (int *x, int n, int a)
43 int res = 0;
44 for (int i = 0; i < n; ++i)
45 res += x[i * 2] == 1 ? 2 : 3;
46 x[a] += 1;
47 return res;
50 int
51 f6 (int *x, int a)
53 int res = 0;
54 for (int i = 0; i < 0x83; ++i)
55 res += x[i * 2] == 1 ? 2 : 3;
56 x[a] += 1;
57 return res;
59 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */