diff options
Diffstat (limited to 'gcc/testsuite/gnat.dg/not_null.adb')
-rw-r--r-- | gcc/testsuite/gnat.dg/not_null.adb | 22 |
1 files changed, 22 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 000000000..3cbd86c16 --- /dev/null +++ b/gcc/testsuite/gnat.dg/not_null.adb @@ -0,0 +1,22 @@ +-- { 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"); + package Inst_2 is new GPack (null); + pragma Warnings (On, "*null not allowed in null-excluding objects"); + begin + null; + end; +exception + when Constraint_Error => + null; +end not_null; |