summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr34457-1.c
blob: ccd937c6b528857378bcf47fee27bf17e4402bf3 (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
/* PR c/34457 */
/* { dg-do compile } */
/* { dg-require-effective-target trampolines } */
/* { dg-options "--combine -O2" } */
/* { dg-additional-sources "pr34457-2.c" } */
   

typedef __SIZE_TYPE__ size_t;
extern int printf (const char *, ...);
extern void *memset (void *, int, size_t);

int bar (int (*)(), int, void *);

int
main(int argc, char **argv)
{
  struct s { int a; char b[argc]; };
  int nested (struct s x) { return x.a + sizeof(x); }
  struct s t;
  memset (&t, 0, sizeof(t));
  t.a = 123;
  printf("%d\n", bar (nested, argc, &t));
  return 0;
}