view gcc/testsuite/gnat.dg/discr7.adb @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 04ced10e8804
children
line wrap: on
line source

-- { dg-do compile }

procedure Discr7 is

  subtype Index is Natural range 0..5;
  type BitString is array(Index range <>) of Boolean;
  pragma Pack(BitString);

  function Id (I : Integer) return Integer is
  begin
    return I;
  end;

  type E(D : Index) is record
    C : BitString(1..D);
  end record;

  subtype E0 is E(Id(0));

  function F return E0 is
  begin
    return E'(D=>0, C=>(1..0=>FALSE));
  end;

begin
  null;
end;