aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-03-23 10:04:08 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-03-23 10:04:08 +0000
commitddb5a105e2252bd2494b523085c101495d59c53a (patch)
tree95fb7ad60a335d8a7918afcbb3f27c23c4dc83b2 /gcc/testsuite
parent3460fdf328976b9f328478e12e0c87c48091d33a (diff)
downloadgcc-ddb5a105e2252bd2494b523085c101495d59c53a.zip
gcc-ddb5a105e2252bd2494b523085c101495d59c53a.tar.gz
gcc-ddb5a105e2252bd2494b523085c101495d59c53a.tar.bz2
trans.c (create_temporary): New function taken from...
* gcc-interface/trans.c (create_temporary): New function taken from... (create_init_temporary): ...here. Call it. (call_to_gnu): Create the temporary for the return value early, if any. Create it for a function with copy-in/copy-out parameters if there is no target; in other cases of copy-in/copy-out, use another temporary. Push the new binding level lazily. Add and rename local variables. From-SVN: r171345
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gnat.dg/discr26.adb19
-rw-r--r--gcc/testsuite/gnat.dg/discr26.ads16
-rw-r--r--gcc/testsuite/gnat.dg/discr26_pkg.ads5
4 files changed, 45 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 31896e2..cfc85e3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-23 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/discr26.ad[sb]: New test.
+ * gnat.dg/discr26_pkg.ads: New helper.
+
2011-03-23 Richard Sandiford <richard.sandiford@linaro.org>
PR target/47553
diff --git a/gcc/testsuite/gnat.dg/discr26.adb b/gcc/testsuite/gnat.dg/discr26.adb
new file mode 100644
index 0000000..2d49888
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr26.adb
@@ -0,0 +1,19 @@
+-- { dg-do compile }
+-- { dg-options "-gnatws" }
+
+package body Discr26 is
+
+ function F1 return My_T1 is
+ R: My_T1;
+ begin
+ return R;
+ end;
+
+ procedure Proc is
+ begin
+ if F1.D = 0 then
+ raise Program_Error;
+ end if;
+ end;
+
+end Discr26;
diff --git a/gcc/testsuite/gnat.dg/discr26.ads b/gcc/testsuite/gnat.dg/discr26.ads
new file mode 100644
index 0000000..5a428f2
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr26.ads
@@ -0,0 +1,16 @@
+with Discr26_Pkg;
+
+package Discr26 is
+
+ type T1 (D : Integer) is record
+ case D is
+ when 1 => I : Integer;
+ when others => null;
+ end case;
+ end record;
+
+ type My_T1 is new T1 (Discr26_Pkg.N);
+
+ procedure Proc;
+
+end Discr26;
diff --git a/gcc/testsuite/gnat.dg/discr26_pkg.ads b/gcc/testsuite/gnat.dg/discr26_pkg.ads
new file mode 100644
index 0000000..ca775eb
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr26_pkg.ads
@@ -0,0 +1,5 @@
+package Discr26_Pkg is
+
+ function N return Integer;
+
+end Discr26_Pkg;