aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/debug8.adb
blob: fabcc22d06ffad1293a2c446c0d04ae9cc6cd4fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- { dg-do compile }
-- { dg-options "-cargs -g -fgnat-encodings=minimal -dA" }
-- { dg-final { scan-assembler-not "DW_OP_const4u" } }
-- { dg-final { scan-assembler-not "DW_OP_const8u" } }

--  The DW_AT_byte_size attribute DWARF expression for the
--  DW_TAG_structure_type DIE that describes Rec_Type contains the -4u literal.
--  Check that it is not created using an inefficient encoding (DW_OP_const1s
--  is expected).

procedure Debug8 is

   type Rec_Type (I : Integer) is record
      B : Boolean;
      case I is
         when 0 =>
            null;
         when 1 .. 10 =>
            C : Character;
         when others =>
            N : Natural;
      end case;
   end record;

   R : access Rec_Type := null;

begin
   null;
end Debug8;