PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / pr35356-3.c
blob8db042ffc6f6ee2c0b4c8bf0055c08bbaaa24561
1 /* { dg-options "-O2 -fgraphite-identity -fdump-tree-graphite-all" } */
4 int winner, numf2s;
5 double **tds;
6 double d, tsum;
8 typedef struct {
9 double y;
10 } xyz;
12 xyz *Y;
13 int ti;
15 double
16 match (void)
18 int tj, tresult;
20 for (tj = 0; tj < numf2s; tj++)
21 if (tj == winner
22 && Y[tj].y > 0)
23 tsum += tds[ti][tj] * d;
25 return tsum;
28 /* There should be no loops generated for this testcase, instead we
29 should generate the following:
31 | if (winner >= 0 && winner < numf2s && Y[winner].y > 0)
32 | tsum += tds[ti][winner] * d;
34 For the moment this is XFAILed as this loop is not detected as a
35 SCoP by graphite: we depend on data in one of the conditions,
36 "Y[winner].y > 0". This could be fixed when we will use predicates
37 for such cases. */
39 /* { dg-final { scan-tree-dump-times "loop_1" 0 "graphite" { xfail *-*-* } } } */
40 /* { dg-final { scan-tree-dump "number of SCoPs: 0" "graphite" } } */