aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gnat.dg/bit_packed_array5.adb
blob: 1f93c6bf7d4a12b1d2d3c08496ede45429ad9dfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- { dg-do compile }

with System;

package body Bit_Packed_Array5 is

   function Inv (Word : Word_Type) return Word_Type is
      W : Word_Type := Word;
      pragma Volatile (W);

      A_W : constant System.Address := W'Address;

      V : Short_Bit_Array_Type;
      for V'Address use A_W;
      pragma Volatile (V);
   begin
      for I in V'Range loop
          V (I) := not V (I);
      end loop;
      return W;
   end;

end Bit_Packed_Array5;