aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr117333.c
blob: 38c1b5493a519fe51464485b76a4f5112d9938db (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
28
29
/* { dg-do compile } */

struct s
{
  unsigned long ul;
  int i;
  char ac[];
};

const struct s gs = { 3, -4, "abcdef" };

void copy_s(struct s*d, const struct s*s)
{
  *d = *s;
}

unsigned test(struct s*ps, _Bool direct)
{
  if(direct)
    *ps = gs;
  else
    copy_s(ps, &gs);
  return sizeof(*ps);
}

unsigned size(void)
{
  return sizeof(gs);
}