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

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

int
bar (int *a)
{
  return *a;
}
int i;
int
foo (int (*a)[2])
{
  return bar (&(*a)[i]);
}

int a[2];
void
testTortureExecute (void)
{
  a[0] = -1;
  a[1] = 42;
  i = 1;
  if (foo (&a) != 42)
    ASSERT (0);
  return;
}