diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr45623.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr45623.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr45623.c b/gcc/testsuite/gcc.dg/torture/pr45623.c new file mode 100644 index 00000000000..2f07d2554b5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr45623.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ + +#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; +} |