summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphython <phython@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-24 16:24:25 +0000
committerphython <phython@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-24 16:24:25 +0000
commitac1137c504025363d57390a20d76539e1bf43679 (patch)
tree56dcc3a4f2b154b40a214d2d0317fb5bbd996648
parentf0c1043db1df04dbd2fd5ce08c6aa2b7ecf6aaba (diff)
downloadgcc-ac1137c504025363d57390a20d76539e1bf43679.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95504 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/treelang/ChangeLog7
-rw-r--r--gcc/testsuite/treelang/execute/execute.exp31
-rw-r--r--gcc/testsuite/treelang/execute/funccall-2.tree28
-rw-r--r--gcc/testsuite/treelang/execute/funccall.tree33
-rw-r--r--gcc/testsuite/treelang/execute/initial.tree20
-rw-r--r--gcc/testsuite/treelang/execute/main.tree14
-rw-r--r--gcc/testsuite/treelang/execute/static.tree32
7 files changed, 165 insertions, 0 deletions
diff --git a/gcc/testsuite/treelang/ChangeLog b/gcc/testsuite/treelang/ChangeLog
index 13021aa1fa1..59db3538710 100644
--- a/gcc/testsuite/treelang/ChangeLog
+++ b/gcc/testsuite/treelang/ChangeLog
@@ -1,5 +1,12 @@
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.
diff --git a/gcc/testsuite/treelang/execute/execute.exp b/gcc/testsuite/treelang/execute/execute.exp
new file mode 100644
index 00000000000..836c3251099
--- /dev/null
+++ b/gcc/testsuite/treelang/execute/execute.exp
@@ -0,0 +1,31 @@
+# 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
diff --git a/gcc/testsuite/treelang/execute/funccall-2.tree b/gcc/testsuite/treelang/execute/funccall-2.tree
new file mode 100644
index 00000000000..43911c9f4f8
--- /dev/null
+++ b/gcc/testsuite/treelang/execute/funccall-2.tree
@@ -0,0 +1,28 @@
+// { dg-do run }
+external_definition int main (int argc);
+
+static int foo (int bba);
+
+foo
+{
+ automatic int bar;
+
+ bar = bba + +1;
+ return bar;
+}
+
+main
+{
+ automatic int aaa = +3;
+
+ aaa = foo (argc);
+
+ if (aaa == +2)
+ {
+ return +0;
+ }
+ else
+ {
+ return +1;
+ }
+}
diff --git a/gcc/testsuite/treelang/execute/funccall.tree b/gcc/testsuite/treelang/execute/funccall.tree
new file mode 100644
index 00000000000..e806d3b583d
--- /dev/null
+++ b/gcc/testsuite/treelang/execute/funccall.tree
@@ -0,0 +1,33 @@
+// { 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;
+}
diff --git a/gcc/testsuite/treelang/execute/initial.tree b/gcc/testsuite/treelang/execute/initial.tree
new file mode 100644
index 00000000000..0daa9970019
--- /dev/null
+++ b/gcc/testsuite/treelang/execute/initial.tree
@@ -0,0 +1,20 @@
+// { 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;
+}
diff --git a/gcc/testsuite/treelang/execute/main.tree b/gcc/testsuite/treelang/execute/main.tree
new file mode 100644
index 00000000000..549f9917895
--- /dev/null
+++ b/gcc/testsuite/treelang/execute/main.tree
@@ -0,0 +1,14 @@
+// { dg-do run }
+external_definition int main (int argc);
+
+main
+{
+ if (argc == 1)
+ {
+ return 0;
+ }
+ else
+ {
+ return argc;
+ }
+}
diff --git a/gcc/testsuite/treelang/execute/static.tree b/gcc/testsuite/treelang/execute/static.tree
new file mode 100644
index 00000000000..370f244604f
--- /dev/null
+++ b/gcc/testsuite/treelang/execute/static.tree
@@ -0,0 +1,32 @@
+// { 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;
+}