summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/pr57793.c
blob: d66fadaa1f754a2252743155bc641481d6a95142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* PR c++/57793 */

struct A { unsigned a : 1; unsigned b : 1; };
struct B     /* { dg-error "type .B. is too large" "" { target { c++ && ilp32 } } } */
{
  unsigned char c[0x40000000];
  unsigned char d[0x40000ff0];
  struct A e;
}; /* { dg-error "type .struct B. is too large" "" { target { c && ilp32 } } } */

void *foo (struct B *p)
{
  if (p->e.a)
    return (void *) 0;
  p->e.b = 1;
  return p->c;
}

void
bar (struct B *p)
{
  foo (p);
}