summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr22061-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/pr22061-4.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr22061-4.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr22061-4.c b/gcc/testsuite/gcc.c-torture/execute/pr22061-4.c
new file mode 100644
index 000000000..38ce3e8c5
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr22061-4.c
@@ -0,0 +1,22 @@
+void
+bar (int N)
+{
+ void foo (int a[2][N++]) {}
+ int a[2][N];
+ foo (a);
+ int b[2][N];
+ foo (b);
+ if (sizeof (a) != sizeof (int) * 2 * 1)
+ abort ();
+ if (sizeof (b) != sizeof (int) * 2 * 2)
+ abort ();
+ if (N != 3)
+ abort ();
+}
+
+int
+main (void)
+{
+ bar (1);
+ exit (0);
+}