summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/array6.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/array6.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/array6.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/array6.C b/gcc/testsuite/g++.old-deja/g++.other/array6.C
new file mode 100644
index 000000000..1ffc42a59
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/array6.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// { dg-options "-O1" }
+
+int count = 0;
+
+double foo () {
+ count++;
+ return 0;
+}
+
+double bar () {
+ const double x[1] = { foo() };
+ return x[0];
+}
+
+int main ()
+{
+ bar();
+ if (count != 1)
+ return 1;
+}