summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/pr42025-1.c
blob: f19123eafa6e22924091c4965ea01730c750328c (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
typedef void* Ptr;

struct A
{
  int i;
  union
  {
    Ptr p;
    char *q;
  } u;
};

static void foo(struct A *p, char *q)
{
  if (p->i)
    p->u.p = 0;
  else
    p->u.q = q;
}

void bar(struct A *p, char *q)
{
  foo(p, q);
}