summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2008-03-31 19:14:08 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-03-31 19:14:08 +0000
commit5a864002b8608352188f6019d28ba15878e05363 (patch)
tree0f65879b64d2251911ce095698a002384eaf0bd2 /gcc/testsuite
parenta12bdb97c9bb28dc996017ec826612ac61dbe846 (diff)
downloadgcc-5a864002b8608352188f6019d28ba15878e05363.tar.gz
decl.c (gnat_to_gnu_entity): Do not force a non-null size if it has overflowed.
* decl.c (gnat_to_gnu_entity) <object>: Do not force a non-null size if it has overflowed. From-SVN: r133768
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gnat.dg/object_overflow.adb14
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b62c44e6650..ba35c2b2542 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2008-03-31 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/object_overflow.adb: New test.
+
2008-03-31 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/30186
diff --git a/gcc/testsuite/gnat.dg/object_overflow.adb b/gcc/testsuite/gnat.dg/object_overflow.adb
new file mode 100644
index 00000000000..820e93656e6
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/object_overflow.adb
@@ -0,0 +1,14 @@
+-- { dg-do compile }
+
+procedure Object_Overflow is
+
+ type Rec is null record;
+
+ procedure Proc (x : Rec) is begin null; end;
+
+ type Arr is array(Long_Integer) of Rec;
+ Obj : Arr; -- { dg-warning "Storage_Error will be raised" }
+
+begin
+ Proc (Obj(1));
+end;