From 1a6587c86fc4b571ea5d825400d48b6aa85230cb Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 5 Aug 2008 14:36:21 +0000 Subject: [PATCH] * gnat.dg/post_block.adb: New test. From-SVN: r138719 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gnat.dg/post_block.adb | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 gcc/testsuite/gnat.dg/post_block.adb diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dda2c2a..1239425 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-08-04 Arnaud Charlet + + * gnat.dg/post_block.adb: New test. + 2008-08-05 Richard Guenther PR middle-end/37026 diff --git a/gcc/testsuite/gnat.dg/post_block.adb b/gcc/testsuite/gnat.dg/post_block.adb new file mode 100644 index 0000000..ac3ee6e --- /dev/null +++ b/gcc/testsuite/gnat.dg/post_block.adb @@ -0,0 +1,27 @@ +-- { dg-do compile } +-- { dg-options "-gnata" } + +procedure Post_Block is + package Pack is + function Size (X : Integer) return Integer; + pragma Postcondition (Size'Result = Value (X)'Length); -- OK + pragma Postcondition (Value (X)'Length = Size'Result); + + -- Calling the following requires a transient block. + function Value (X : Integer) return String; + end Pack; + + package body Pack is + function Size (X : Integer) return Integer is + begin + return 0; + end; + + function Value (X : Integer) return String is + begin + return Integer'image (X); + end; + end Pack; +begin + null; +end; -- 2.7.4