Debian Codegraph @

gcc/testsuite/gnat.dg/atomic10.adb

raw
1 -- { dg-do compile }
2 -- { dg-options "-gnatws" }
3
4 with System.Multiprocessors;
5
6 procedure Atomic10 is
7
8 type Atomic_Unsigned is mod 2 ** 32;
9 pragma Atomic (Atomic_Unsigned);
10
11 Max : Positive := Positive (System.Multiprocessors.Number_Of_CPUs);
12
13 Comp_Size : constant := 64 * 8;
14
15 subtype Index_Type is Positive range 1 .. Max;
16
17 type Array_Type is array (Index_Type) of aliased Atomic_Unsigned;
18 for Array_Type'Component_Size use Comp_Size; -- { dg-error "incorrect|only" }
19
20 Slots : Array_Type;
21 begin
22 for Index in Index_Type loop
23 Slots (Index) := 0;
24 end loop;
25 end;