* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Don't
[official-gcc.git] / gcc / testsuite / gnat.dg / debug11.adb
blob19c1c43486da9e7f0e8622deb9abb0781eacd0a7
1 -- { dg-do compile }
2 -- { dg-options "-cargs -O0 -g -dA -fgnat-encodings=minimal -margs" }
3 --
4 -- This testcase checks that in the DWARF description of the variant type
5 -- below, the C discriminant is properly described as unsigned, hence the 0x5a
6 -- ('Z') and 0x80 (128) values in the DW_AT_discr_list attribute. If it was
7 -- described as signed, we would have instead 90 and -128.
8 --
9 -- { dg-final { scan-assembler-times "0x5a.*DW_AT_discr_list" 1 } }
10 -- { dg-final { scan-assembler-times "0x80.*DW_AT_discr_list" 1 } }
12 with Ada.Text_IO;
14 procedure Debug11 is
15 type Rec_Type (C : Character) is record
16 case C is
17 when 'Z' .. Character'Val (128) => I : Integer;
18 when others => null;
19 end case;
20 end record;
21 -- R : Rec_Type := ('Z', 2);
22 R : Rec_Type ('Z');
23 begin
24 R.I := 0;
25 Ada.Text_IO.Put_Line ("" & R.C);
26 end Debug11;