--  Concatenation of null arrays (RM 4.5.3(6-7)): when the left operand is a null array the
--  result is the right operand, so all-null operands give the last one's bounds (GNAT
--  prints the same: 7 6, 3 4, 3 4, the index subtype's first for a component, 8 7).
with Ada.Text_IO; use Ada.Text_IO;

procedure Main is
   type Arr is array (Integer range <>) of Integer;
   A : constant Arr (5 .. 4) := (others => 0);
   B : constant Arr (7 .. 6) := (others => 0);
   D : constant Arr (3 .. 4) := (others => 1);
   C : constant Arr := A & B;
   E : constant Arr := A & D;
   F : constant Arr := D & B;
   G : constant Arr := A & 9;
   S1 : constant String (4 .. 3) := "";
   S2 : constant String (8 .. 7) := "";
   S3 : constant String := S1 & S2;
begin
   Put_Line (Integer'Image (C'First) & Integer'Image (C'Last));
   Put_Line (Integer'Image (E'First) & Integer'Image (E'Last));
   Put_Line (Integer'Image (F'First) & Integer'Image (F'Last));
   Put_Line (Integer'Image (G'First) & Integer'Image (G'Last));
   Put_Line (Integer'Image (S3'First) & Integer'Image (S3'Last));
end Main;
