diff options
author | Arnaud Charlet <charlet@adacore.com> | 2008-08-05 09:33:21 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2008-08-05 11:33:21 +0200 |
commit | a96ced8e6f0eb5bfc3c1144096c3c2adeaf87731 (patch) | |
tree | 776274a7e484bed2e53ef7c48c4034e7b01542d0 /gcc/testsuite/gnat.dg | |
parent | c775e4a16cd3e99a9dd857db0dd2229c44a44c46 (diff) | |
download | gcc-a96ced8e6f0eb5bfc3c1144096c3c2adeaf87731.zip gcc-a96ced8e6f0eb5bfc3c1144096c3c2adeaf87731.tar.gz gcc-a96ced8e6f0eb5bfc3c1144096c3c2adeaf87731.tar.bz2 |
* gnat.dg/not_null.adb: New test.
From-SVN: r138694
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r-- | gcc/testsuite/gnat.dg/not_null.adb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/not_null.adb b/gcc/testsuite/gnat.dg/not_null.adb new file mode 100644 index 0000000..7d3c63d --- /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; |