diff options
author | Arnaud Charlet <charlet@adacore.com> | 2008-08-05 14:36:21 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2008-08-05 16:36:21 +0200 |
commit | 1a6587c86fc4b571ea5d825400d48b6aa85230cb (patch) | |
tree | 9b04baf22f37913a2c1d607864b84d80dfc6a7ab /gcc/testsuite/gnat.dg | |
parent | 302c3d8e6e6a4bb7ab19b92360e1956b788b7fc3 (diff) | |
download | gcc-1a6587c86fc4b571ea5d825400d48b6aa85230cb.zip gcc-1a6587c86fc4b571ea5d825400d48b6aa85230cb.tar.gz gcc-1a6587c86fc4b571ea5d825400d48b6aa85230cb.tar.bz2 |
* gnat.dg/post_block.adb: New test.
From-SVN: r138719
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r-- | gcc/testsuite/gnat.dg/post_block.adb | 27 |
1 files changed, 27 insertions, 0 deletions
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; |