summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gnat.dg/atomic3.adb
blob: 592a856caef84775ab5d59689a5cbb2745b776f6 (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
-- { dg-do compile }

procedure Atomic3 is

   type Unsigned_32_T is mod 2 ** 32;
   for Unsigned_32_T'Size use 32;

   type Id_T is (One, Two, Three);

   type Array_T is array (Id_T) of Unsigned_32_T;
   pragma Atomic_Components (Array_T);

   A : Array_T := (others => 0);

   function Get_Array return Array_T is
   begin
      return A;
   end;

   X : Array_T;

begin
   X := Get_Array;
end;
OpenPOWER on IntegriCloud