]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/loop-invariant.c
replace ISL with isl
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / loop-invariant.c
CommitLineData
315a349c
DS
1/* { dg-do compile { target x86_64-*-* } } */
2/* { dg-options "-O2 -fdump-rtl-loop2_invariant" } */
3/* NOTE: The target list above could be extended to other targets that have
4 conditional moves, but don't have zero registers. */
5
6enum test_type
7{
8 TYPE0,
9 TYPE1
10};
11
12struct type_node
13{
14 enum test_type type;
15};
16
17struct test_ref
18{
19 struct type_node *referring;
20};
21
22struct test_node
23{
24 struct test_node *next;
25};
26
27int iterate (struct test_node *, unsigned, struct test_ref **);
28
29int
30loop_invar (struct test_node *node)
31{
32 struct test_ref *ref;
33
34 for (unsigned i = 0; iterate (node, i, &ref); i++)
35 if (loop_invar ((ref->referring && ref->referring->type == TYPE0)
36 ? ((struct test_node *) (ref->referring)) : 0))
37 return 1;
38
39 return 0;
40}
41
42/* { dg-final { scan-rtl-dump "Decided to move invariant" "loop2_invariant" } } */