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

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

struct test1
{
  int a;
  int b;
};
struct test2
{
  float d;
  struct test1 sub;
};

int global;

int bla(struct test1 *xa, struct test2 *xb)
{
  global = 1;
  xb->sub.a = 1;
  xa->a = 8;
  return xb->sub.a;
}

void
testTortureExecute (void)
{
  struct test2 pom;

  if (bla (&pom.sub, &pom) != 8)
    ASSERT (0);

  return;
}