From: Arnaud Charlet Date: Tue, 5 Aug 2008 09:33:21 +0000 (+0000) Subject: * gnat.dg/not_null.adb: New test. X-Git-Tag: releases/gcc-4.4.0~3361 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a96ced8e6f0eb5bfc3c1144096c3c2adeaf87731;p=thirdparty%2Fgcc.git * gnat.dg/not_null.adb: New test. From-SVN: r138694 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 393a8d23091e..70085b14ba56 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,7 @@ 2008-08-04 Arnaud Charlet * gnat.dg/access_discr2.adb: New test. + * gnat.dg/not_null.adb: New test. 2008-08-04 Richard Guenther diff --git a/gcc/testsuite/gnat.dg/not_null.adb b/gcc/testsuite/gnat.dg/not_null.adb new file mode 100644 index 000000000000..7d3c63dc9cdd --- /dev/null +++ b/gcc/testsuite/gnat.dg/not_null.adb @@ -0,0 +1,24 @@ +-- { dg-do run } + +procedure not_null is + type Not_Null_Int_Ptr is not null access all Integer; + + generic + F : Not_Null_Int_Ptr := null; + package GPack is + end GPack; + +begin + declare + pragma Warnings (Off, "*null not allowed in null-excluding objects"); + pragma Warnings (Off, """Constraint_Error"" will be raised at run time"); + package Inst_2 is new GPack (null); + pragma Warnings (On, "*null not allowed in null-excluding objects"); + pragma Warnings (On, """Constraint_Error"" will be raised at run time"); + begin + null; + end; +exception + when Constraint_Error => + null; +end not_null;