1 -- The aim of this test is to check that Ada types appear in the proper
2 -- context in the debug info.
4 -- Checking this directly would be really tedious just scanning for assembly
5 -- lines, so instead we rely on DWARFv4's .debug_types sections, which must be
6 -- created only for global-scope types. Checking the number of .debug_types is
7 -- some hackish way to check that types are output in the proper context (i.e.
8 -- at global or local scope).
10 -- { dg-skip-if "No dwarf-4 support" { hppa*-*-hpux* } }
11 -- { dg-options "-cargs -gdwarf-4 -fdebug-types-section -dA -margs" }
12 -- { dg-final { scan-assembler-times "\\(DIE \\(0x\[a-f0-9\]*\\) DW_TAG_type_unit\\)" 0 } }
15 type Array_Type
is array (Natural range <>) of Integer;
16 type Record_Type
(L1
, L2
: Natural) is record
18 A1
: Array_Type
(1 .. L1
);
20 A2
: Array_Type
(1 .. L2
);
24 function Get
(L1
, L2
: Natural) return Record_Type
is
25 Result
: Record_Type
(L1
, L2
);
28 for I
in Result
.A1
'Range loop
32 for I
in Result
.A2
'Range loop
39 R1
: Record_Type
:= Get
(0, 0);
40 R2
: Record_Type
:= Get
(1, 0);
41 R3
: Record_Type
:= Get
(0, 1);
42 R4
: Record_Type
:= Get
(2, 2);
44 procedure Process
(R
: Record_Type
) is