| 1 |
-- { dg-do run } |
| 2 |
|
| 3 |
with Text_IO; use Text_IO; |
| 4 |
procedure Named_Test is |
| 5 |
type Base is tagged limited record |
| 6 |
Flag : boolean; |
| 7 |
Value : integer; |
| 8 |
end record; |
| 9 |
-- |
| 10 |
function Build (X : Integer; Y : Integer) return Base is |
| 11 |
begin |
| 12 |
return Result : Base do |
| 13 |
Result.Flag := (X = Y); |
| 14 |
Result.Value := X * Y; |
| 15 |
end return; |
| 16 |
end; |
| 17 |
-- |
| 18 |
type Table is array (1..1) of Base; |
| 19 |
It : Table := (1 => Build ( Y => 17, X => 11)); |
| 20 |
begin |
| 21 |
if It (1).Flag |
| 22 |
or else It (1).Value /= 187 |
| 23 |
then |
| 24 |
raise Program_Error; |
| 25 |
end if; |
| 26 |
end; |