Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gcc.dg / loop-unswitch-12.c
blob052c456846c3abc3f6b0f6db5d67ebe49b775439
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-optimized" } */
4 int
5 foo(double *a, double *b, double *c, double *d, double *r, int size, int order)
7 for (int i = 0; i < size; i++)
9 double tmp;
11 if (order == 1)
12 tmp = -8 * a[i];
13 else
14 tmp = -4 * b[i];
16 double x = 3 * tmp + d[i] + tmp;
18 if (order == 1)
19 x += 2;
21 double y = 3.4f * tmp + d[i];
22 r[i] = x + y;
25 return 0;
28 /* { dg-final { scan-tree-dump-times "unswitching loop . on .if. with condition: order.* == 1" 1 "unswitch" } } */