Commit bf6eb87b by Nick Clifton Committed by Nick Clifton

New test from PR 17544

From-SVN: r22719
parent b84bfa3c
Thu Oct 1 17:15:26 1998 Nick Clifton <nickc@cygnus.com>
* compile/981001-1.c (main): New test.
* compile/981001-1.c: New test.
* execute/981001-1.c: New test.
Wed Aug 26 16:10:00 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
......
#define NG 0x100L
unsigned long flg = 0;
long sub (int n)
{
int a, b ;
if (n >= 2)
{
if (n % 2 == 0)
{
a = sub (n / 2);
return (a + 2 * sub (n / 2 - 1)) * a;
}
else
{
a = sub (n / 2 + 1);
b = sub (n / 2);
return a * a + b * b;
}
}
else
return (long) n;
}
int main (void)
{
if (sub (30) != 832040L)
flg |= NG;
if (flg)
abort ();
exit (0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment