view gcc/testsuite/gcc.c-torture/compile/nested-1.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

/* { dg-require-effective-target trampolines } */

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;
}