summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-20000412-2.c
blob: 8693fb1f981771036a7c8a11a445ef021e952b10 (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
/*
   20000412-2.c from the execute part of the gcc torture tests.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

#if !(defined (__SDCC_hc08) || defined (__SDCC_s08))
int f(int a,int *y)
{
  int x = a;

  if (a==0)
    return *y;

  return f(a-1,&x);
}
#endif

void
testTortureExecute (void)
{
#ifndef __SDCC_pic16
#if !(defined (__SDCC_mcs51) || defined (__SDCC_hc08) || defined (__SDCC_s08) || defined (__SDCC_ds390) || defined (__SDCC_pdk13) || defined (__SDCC_pdk14) || defined (__SDCC_pdk15))
  if (f (10, (int *) 0) != 1)
    ASSERT (0);
  return;
#endif
#endif
}