Merged r158465 through r158660 into branch.
[official-gcc.git] / gcc / testsuite / gnat.dg / rep_clause5.adb
blob7fdf264095adee3b8ed4b85ec7a19ef729188417
1 -- { dg-do compile }
2 -- { dg-options "-O" }
4 package body Rep_Clause5 is
6 function To_LNumber(S : String) return LNumber_Type is
7 V : VString;
8 LV : Long_Type;
9 LN : LNumber_Type;
10 begin
11 LV := To_Long(V, 10);
12 LN := LNumber_Type(LV);
13 return LN;
14 end;
16 procedure Merge_Numbered(LNodes : in out LNodes_Ptr) is
17 T1 : Token_Type;
18 LNO : LNumber_Type;
19 begin
20 for X in LNodes.all'Range loop
21 T1 := LNodes(X).Line(0);
22 if T1.Token /= LEX_LF then
23 declare
24 S : String := Element(T1.SID);
25 begin
26 begin
27 LNO := To_LNumber(S);
28 exception
29 when Bad_Number =>
30 LNO := 0;
31 when Too_Large =>
32 LNO := 0;
33 end;
34 end;
35 end if;
36 end loop;
37 end;
39 end Rep_Clause5;