PR ada/53766
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 15 Dec 2012 18:11:38 +0000 (18:11 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 15 Dec 2012 18:11:38 +0000 (18:11 +0000)
* gnat.dg/controlled7.ad[sb]: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194521 138bc75d-0d04-0410-961f-82ee72b054a4

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

index e3776f3..fc21c18 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-15  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR ada/53766
+       * gnat.dg/controlled7.ad[sb]: New test.
+
 2012-12-14  Steve Ellcey  <sellcey@mips.com>
 
        PR regression/55688
diff --git a/gcc/testsuite/gnat.dg/controlled7.adb b/gcc/testsuite/gnat.dg/controlled7.adb
new file mode 100644 (file)
index 0000000..bdcf67a
--- /dev/null
@@ -0,0 +1,18 @@
+-- PR ada/53766
+-- Reported by Duncan Sands <baldrick@gcc.gnu.org>
+
+-- { dg-do compile }
+-- { dg-options "-gnatp" }
+
+with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
+
+package body Controlled7 is
+
+   procedure Proc (Offset : Storage_Offset) is
+   begin
+      if Offset + Unbounded_String'Max_Size_In_Storage_Elements >= 16 then
+         raise Program_Error;
+      end if;
+   end;
+
+end Controlled7;
diff --git a/gcc/testsuite/gnat.dg/controlled7.ads b/gcc/testsuite/gnat.dg/controlled7.ads
new file mode 100644 (file)
index 0000000..672a8e7
--- /dev/null
@@ -0,0 +1,7 @@
+with System.Storage_Elements; use System.Storage_Elements;
+
+package Controlled7 is
+
+  procedure Proc (Offset : Storage_Offset);
+
+end Controlled7;