middle-end: Fix stalled swapped condition code value [PR115836]
[official-gcc.git] / gcc / testsuite / gcc.dg / pr33826.c
blobd2227743a943e772fdde406ee8f608480da90b49
1 /* Regression test for PR middle-end/33826 */
2 /* Verify that recursive functions cannot be pure or const. */
4 /* { dg-do compile { target { nonpic || pie_enabled } } } */
5 /* { dg-options "-O1 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const" } */
7 int recurse1 (int);
8 int recurse2b (int);
9 int norecurse1b (int);
11 int recurese1 (int i)
13 return recurse1 (i+1);
16 int recurse2a (int i)
18 return recurse2b (i+1);
21 int recurse2b (int i)
23 return recurse2a (i+1);
26 int norecurse1a (int i)
28 return norecurse1b (i+1);
31 int norecurse1b (int i)
33 return i+1;
36 /* { dg-final { scan-tree-dump "found to be const: norecurse1a" "local-pure-const1" } } */
37 /* { dg-final { scan-tree-dump "found to be const: norecurse1b" "local-pure-const1" } } */
38 /* { dg-final { scan-tree-dump-not "found to be pure: recurse1" "local-pure-const1" } } */
39 /* { dg-final { scan-tree-dump-not "found to be pure: recurse2a" "local-pure-const1" } } */
40 /* { dg-final { scan-tree-dump-not "found to be pure: recurse2b" "local-pure-const1" } } */
41 /* { dg-final { scan-tree-dump-not "found to be const: recurse1" "local-pure-const1" } } */
42 /* { dg-final { scan-tree-dump-not "found to be const: recurse2a" "local-pure-const1" } } */
43 /* { dg-final { scan-tree-dump-not "found to be const: recurse2b" "local-pure-const1" } } */
44 /* { dg-final { scan-ipa-dump-not "found to be pure: recurse1" "pure-const" } } */
45 /* { dg-final { scan-ipa-dump-not "found to be pure: recurse2a" "pure-const" } } */
46 /* { dg-final { scan-ipa-dump-not "found to be pure: recurse2b" "pure-const" } } */
47 /* { dg-final { scan-ipa-dump-not "found to be const: recurse1" "pure-const" } } */
48 /* { dg-final { scan-ipa-dump-not "found to be const: recurse2a" "pure-const" } } */
49 /* { dg-final { scan-ipa-dump-not "found to be const: recurse2b" "pure-const" } } */