2005-02-24 James A. Morrison <phython@gcc.gnu.org>
+ PR other/19896
+ * execute/execute.exp: New file.
+ * execute/funccall.tree, execute/funccall-2.tree, execute/initial.tree,
+ execute/main.tree, execute/static.tree: New tests.
+
+2005-02-24 James A. Morrison <phython@gcc.gnu.org>
+
PR other/19897
* compile/exit.tree, compile/extref.tree, compile/function-1.tree,
compile/syntax-1.tree: New tests.
--- /dev/null
+# Tests for treelang; run from gcc/treelang/Make-lang.in => gcc/Makefile
+
+# Copyright (C) 2004 by The Free Software Foundation
+
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+#
+# In other words, you are welcome to use, share and improve this program.
+# You are forbidden to forbid anyone else to use, share and improve
+# what you give them. Help stamp out software-hoarding!
+
+# Treelang tests that only need to compile.
+
+# Load support procs.
+load_lib treelang-dg.exp
+
+dg-init
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.tree]] "" ""
+dg-finish
--- /dev/null
+// { dg-do run }
+// Tests whether initializtion works properly.
+external_reference void abort ();
+external_reference void exit (int code);
+external_definition int main ();
+
+static int foo ();
+
+foo
+{
+ automatic int bar;
+
+ bar = +1;
+ bar = bar + +1;
+ return bar;
+}
+
+main
+{
+ automatic int aaa;
+
+ aaa = foo ();
+
+ if (aaa == +2)
+ {
+ exit (0);
+ }
+ else
+ {
+ abort ();
+ }
+ return 0;
+}
--- /dev/null
+// { dg-do run }
+// Tests whether initializtion works properly.
+external_reference void abort ();
+external_reference void exit (int code);
+external_definition int main ();
+
+main
+{
+ automatic int aaa = +3;
+
+ if (aaa == +3)
+ {
+ exit (0);
+ }
+ else
+ {
+ abort ();
+ }
+ return 0;
+}
--- /dev/null
+// { dg-do run }
+external_reference void abort ();
+external_reference void exit (int code);
+external_definition int main (int argc, int argv);
+
+static int foo ();
+
+foo
+{
+ static int bar = +1;
+
+ bar = bar + +1;
+ return bar;
+}
+
+main
+{
+ automatic int aaa = +3;
+
+ aaa = foo ();
+ aaa = foo ();
+
+ if (aaa == 3)
+ {
+ exit (0);
+ }
+ else
+ {
+ abort ();
+ }
+ return 0;
+}