blob: 52eb9d7b56fe790667664098baaa122ef8aee835 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
/*
981001-1.c from the execute part of the gcc torture suite.
*/
#include <testfwk.h>
#ifdef __SDCC
#pragma std_c99
#endif
#define NG 0x100L
#if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
unsigned long flg = 0;
long sub (int n) __reentrant
{
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;
}
#endif
void
testTortureExecute (void)
{
#if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
if (sub (30) != 832040L)
flg |= NG;
if (flg)
ASSERT (0);
return;
#endif
}
|