infinite recursion detected in gold testcase
gold/testsuite/icf_test.cc:32:5: error: infinite recursion detected [-Werror=infinite-recursion] 32 | int kept_func() | ^~~~~~~~~ * testsuite/icf_test.cc: Avoid infinite recursion error.
This commit is contained in:
parent
5224aea8c2
commit
b9255b7808
1 changed files with 6 additions and 4 deletions
|
@ -29,19 +29,21 @@ int common()
|
|||
return 1;
|
||||
}
|
||||
|
||||
int kept_func()
|
||||
int kept_func(int i)
|
||||
{
|
||||
common();
|
||||
// Recursive call.
|
||||
kept_func();
|
||||
if (i)
|
||||
kept_func(i - 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int folded_func()
|
||||
int folded_func(int i)
|
||||
{
|
||||
common();
|
||||
// Recursive call.
|
||||
folded_func();
|
||||
if (i)
|
||||
folded_func(i - 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue