summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug-2497.c
blob: b6889fd22896358780fb2f4894a4e9b675687b01 (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
/*
   bug-2497.c
 */

#include <testfwk.h>

#if !defined( __SDCC_pdk14) && !defined( __SDCC_pdk15)
typedef int func_t (int a);
typedef int (*func_p_t)(int a);

int fa (int a)
{
  return a + 1;
}

int fb (int b)
{
  return b + 10;
}

func_t *pa[2] = {fa, fb};
func_p_t pb[2] = {fb, fa};
#endif

void testBug (void)
{
#if !defined( __SDCC_pdk14) && !defined( __SDCC_pdk15)
  ASSERT (pa[0](5) == 6);
  ASSERT (pa[1](5) == 15);
  ASSERT (pb[0](15) == 25);
  ASSERT (pb[1](15) == 16);
#endif
}