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:
Alan Modra 2022-01-05 11:39:12 +10:30
parent 5224aea8c2
commit b9255b7808

View File

@ -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;
}