* gnat.dg/post_block.adb: New test.
authorArnaud Charlet <charlet@adacore.com>
Tue, 5 Aug 2008 14:36:21 +0000 (14:36 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 5 Aug 2008 14:36:21 +0000 (16:36 +0200)
From-SVN: r138719

gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/post_block.adb [new file with mode: 0644]

index dda2c2a..1239425 100644 (file)
@@ -1,3 +1,7 @@
+2008-08-04  Arnaud Charlet  <charlet@adacore.com>
+
+       * gnat.dg/post_block.adb: New test.
+
 2008-08-05  Richard Guenther  <rguenther@suse.de>
 
        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 (file)
index 0000000..ac3ee6e
--- /dev/null
@@ -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;