PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr80631-1.c
blobf2405198a10b2deef85e8d21cecc695f735142e3
1 /* PR tree-optimization/80631 */
3 #include "tree-vect.h"
5 int v[8] = { 77, 1, 79, 3, 4, 3, 6, 7 };
7 __attribute__((noipa)) void
8 f1 (void)
10 int k, r = -1;
11 for (k = 0; k < 8; k++)
12 if (v[k] == 77)
13 r = k;
14 if (r != 0)
15 abort ();
18 __attribute__((noipa)) void
19 f2 (void)
21 int k, r = 4;
22 for (k = 0; k < 8; k++)
23 if (v[k] == 79)
24 r = k;
25 if (r != 2)
26 abort ();
29 __attribute__((noipa)) void
30 f3 (void)
32 int k, r = -17;
33 for (k = 0; k < 8; k++)
34 if (v[k] == 78)
35 r = k;
36 if (r != -17)
37 abort ();
40 __attribute__((noipa)) void
41 f4 (void)
43 int k, r = 7;
44 for (k = 0; k < 8; k++)
45 if (v[k] == 78)
46 r = k;
47 if (r != 7)
48 abort ();
51 __attribute__((noipa)) void
52 f5 (void)
54 int k, r = -1;
55 for (k = 0; k < 8; k++)
56 if (v[k] == 3)
57 r = k;
58 if (r != 5)
59 abort ();
62 int
63 main ()
65 check_vect ();
66 f1 ();
67 f2 ();
68 f3 ();
69 f4 ();
70 f5 ();
71 return 0;
74 /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 5 "vect" { target vect_condition } } } */
75 /* { dg-final { scan-tree-dump-times "optimizing condition reduction with FOLD_EXTRACT_LAST" 10 "vect" { target vect_fold_extract_last } } } */
76 /* { dg-final { scan-tree-dump-times "condition expression based on integer induction." 10 "vect" { target { { ! vect_fold_extract_last } && vect_condition } } } } */