view gcc/testsuite/gnat.dg/not_null.adb @ 143:76e1cf5455ef

add cbc_gc test
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:24:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

--  { 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;