Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gnat.dg / predicate11.adb
blobdc92a9182dc1115479ece1bbe44e47957de5146f
1 -- { dg-do compile }
2 -- { dg-options "-gnata" }
4 procedure Predicate11 is
5 type T_BYTES is new Integer range 0 .. 2**15 - 1 with Size => 32;
6 subtype TYPE5_SCALAR is T_BYTES
7 with Dynamic_Predicate => TYPE5_SCALAR mod 4 = 0;
8 subtype Cond is Integer
9 with dynamic_predicate => (if cond < 5 then false else True);
11 Thing1 : Type5_Scalar := 7; -- { dg-warning "check will fail at run time" }
12 function OK (C :Type5_scalar) return Boolean is (True);
13 Thing2 : Type5_Scalar;
14 Thing3 : Cond;
15 begin
16 if not OK (7) then raise Program_Error; end if; -- { dg-warning "check will fail at run time" }
17 Thing2 := 8;
18 Thing3 := 1; -- { dg-warning "check will fail at run time" }
19 end;