* c-common.c (get_priority): Add check for
[official-gcc.git] / gcc / testsuite / gnat.dg / frame_overflow.adb
blob4172fc013ce993c81c823fde7688ac69584e2612
1 -- { dg-do compile }
3 procedure frame_overflow is
5 type Bitpos_Range_T is new Positive;
6 type Bitmap_Array_T is array (Bitpos_Range_T) of Boolean;
8 type Bitmap_T is record
9 Bits : Bitmap_Array_T := (others => False);
10 end record;
12 function -- { dg-error "too large" "" }
13 Set_In (Bitmap : Bitmap_T; Bitpos : Bitpos_Range_T) return Bitmap_T
15 Result: Bitmap_T := Bitmap;
16 begin
17 Result.Bits (Bitpos) := True;
18 return Result;
19 end;
21 function -- { dg-error "too large" "" }
22 Negate (Bitmap : Bitmap_T) return Bitmap_T is
23 Result: Bitmap_T;
24 begin
25 for E in Bitpos_Range_T loop
26 Result.Bits (E) := not Bitmap.Bits (E);
27 end loop;
28 return Result;
29 end;
31 begin
32 null;
33 end;