aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gnat.dg/misaligned_param.adb
blob: dd591d06a8348fb4cffcb75ad94afb9ad12ae597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- { dg-do run }
-- { dg-options "-gnatws" }

with Misaligned_Param_Pkg;

procedure Misaligned_Param is

   procedure Channel_Eth (Status : out Integer; Kind : out Integer);

   pragma Import (External, Channel_Eth);
   pragma Import_Valued_Procedure
     (Channel_Eth, "channel_eth", (Integer, Integer), (VALUE, REFERENCE));

   type Channel is record
      B : Boolean;
      Kind : Integer;
   end record;
   pragma Pack (Channel);

   MyChan : Channel;
   Status : Integer;

begin
   MyChan.Kind := 0;
   Channel_Eth (Status => Status, Kind => MyChan.Kind);

   if Mychan.Kind = 0 then
      raise Program_Error;
   end if;
end;