aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/20021006-1.c
blob: 63cc8a5af09404aa4e7a6c5bfdde1bfca937004b (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
/* PR target/7559
   This testcase was miscompiled on x86-64 due to wrong access to the struct
   members.  */

extern void abort();

struct A {
  long x;
};

struct R {
  struct A a, b;
};

struct R R = {
  {100}, {200}
};

void f(struct R r) {
  if (r.a.x != R.a.x || r.b.x != R.b.x)
    abort();
}

int main() {
  f(R);
  return 0;
}