PR target/84336
[official-gcc.git] / gcc / testsuite / gnat.dg / vfa1_2.adb
blobd6ec28514d2a5f0604e58ed27536945d2d235cb3
1 -- { dg-do compile }
2 -- { dg-options "-fdump-tree-gimple" }
4 with VFA1_Pkg; use VFA1_Pkg;
6 procedure VFA1_2 is
7 Temp : Int8_t;
9 function F (I : Int8_t) return Int8_t is
10 begin
11 return I;
12 end;
14 function F2 return Int8_t is
15 begin
16 return Int8_t(Timer1(1));
17 end;
19 procedure P3 (I : out Int8_t) is
20 begin
21 null;
22 end;
24 begin
26 Temp := Timer1(1);
27 Timer1(2) := Temp;
29 Temp := Timer2(1);
30 Timer2(2) := Temp;
32 Temp := Timer1(1) + Timer2(2);
34 if Timer1(1) /= Timer2(2) then
35 raise Program_Error;
36 end if;
38 Temp := F(Timer1(1));
39 Timer2(2) := F(Temp);
41 Temp := F(Timer2(2));
42 Timer1(1) := F(Temp);
44 Temp := F2;
45 P3 (Timer2(2));
47 end;
49 -- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&vfa1_pkg__timer1" 7 "gimple"} }
50 -- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&vfa1_pkg__timer2" 7 "gimple"} }
51 -- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&temp" 0 "gimple"} }
53 -- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&vfa1_pkg__timer1" 2 "gimple"} }
54 -- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&vfa1_pkg__timer2" 3 "gimple"} }
55 -- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&temp" 0 "gimple"} }