aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/20010113-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/compile/20010113-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/20010113-1.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/20010113-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/20010113-1.c
new file mode 100644
index 000000000..35b7c1f1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/20010113-1.c
@@ -0,0 +1,15 @@
+/* Origin: PR c/364 from and@genesyslab.com, very much reduced to a
+ testcase by Joseph Myers <jsm28@cam.ac.uk>.
+
+ The initializer of z is a valid address constant, and GCC 2.95.2
+ accepts it as such. CVS GCC as of 2001-01-13 rejects it, but accepts
+ it if y is changed to x in the initializer. */
+
+struct {
+ struct {
+ int x;
+ int y;
+ } p;
+} v;
+
+int *z = &((&(v.p))->y);