aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/treelang/execute/funccall.tree
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/treelang/execute/funccall.tree')
-rw-r--r--gcc/testsuite/treelang/execute/funccall.tree33
1 files changed, 33 insertions, 0 deletions
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;
+}