view gcc/testsuite/gnat.dg/range_check7.adb @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
line wrap: on
line source

--  { dg-do compile }
--  { dg-options "-gnatVa" }

procedure Range_Check7 is

  type Short is range -32768 .. 32767;

  type Int is range -2 ** 31 .. 2 ** 31 - 1;

  subtype Nat is Int range 0 .. Int'Last;

  type Ptr is access all Short;

  procedure Proc (P : Ptr) is
    N : constant Nat := Nat (P.all);
  begin
    null;
  end;

begin
  null;
end;