summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr45623.c
blob: 693a8c4c7be660e371e6383dce79db08216c971b (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 run } */
/* { dg-options "-std=c99" } */

#include <stdint.h>

extern void abort (void);

char *s1 = "foo";
char *s2 = "bar";

char **ss1 = &s1;

typedef union jsval_layout
{
    uint64_t asBits;
    char **ptr;
} jsval_layout;

int main()
{
  jsval_layout l, m;
  l.ptr = ss1;
  m.asBits = l.asBits;
  char ** data = m.ptr;
  *data = s2;
  if (s1 != s2)
    abort ();
  return 0;
}