| 1 |
-- { dg-do compile } |
| 2 |
-- { dg-options "-flto" { target lto } } |
| 3 |
|
| 4 |
with Ada.Unchecked_Conversion; |
| 5 |
with System; |
| 6 |
|
| 7 |
package body Lto30 is |
| 8 |
|
| 9 |
generic |
| 10 |
type T is private; |
| 11 |
package Unbounded_Arrays is |
| 12 |
type Unbounded_Array is array (Natural range 1 .. Natural'Last) of T; |
| 13 |
type Unbounded_Array_Access is access Unbounded_Array; |
| 14 |
function Convert is new |
| 15 |
Ada.Unchecked_Conversion (System.Address, Unbounded_Array_Access); |
| 16 |
end Unbounded_Arrays; |
| 17 |
|
| 18 |
package Atom_Arrays is new Unbounded_Arrays (Ptr); |
| 19 |
use Atom_Arrays; |
| 20 |
|
| 21 |
procedure Proc is |
| 22 |
procedure Foo (Targets : access Unbounded_Array_Access); |
| 23 |
pragma Import (Ada, Foo, "Foo"); |
| 24 |
|
| 25 |
Output : aliased Unbounded_Array_Access; |
| 26 |
|
| 27 |
begin |
| 28 |
Foo (Output'Unchecked_Access); |
| 29 |
end; |
| 30 |
|
| 31 |
end Lto30; |