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

#include <testfwk.h>

#define NULL 0

struct stuff
{
    int a;
    int b;
    int c;
    int d;
    int e;
    char *f;
    int g;
};

void
bar (struct stuff *x)
{
  if (x->g != 2)
    ASSERT (0);
}

void
testTortureExecute (void)
{
  struct stuff x = {0, 0, 0, 0, 0, NULL, 0};
  x.a = 100;
  x.d = 100;
  x.g = 2;
  /* Struct should now look like {100, 0, 0, 100, 0, 0, 0, 2}.  */
  bar (&x);
  return;
}