| 1 |
-- { dg-do compile } |
| 2 |
-- { dg-options "-fdump-tree-gimple" } |
| 3 |
|
| 4 |
with VFA1_Pkg; use VFA1_Pkg; |
| 5 |
|
| 6 |
procedure VFA1_1 is |
| 7 |
Temp : Integer; |
| 8 |
|
| 9 |
function F (I : Integer) return Integer is |
| 10 |
begin |
| 11 |
return I; |
| 12 |
end; |
| 13 |
|
| 14 |
function F2 return Integer is |
| 15 |
begin |
| 16 |
return Integer(Counter1); |
| 17 |
end; |
| 18 |
|
| 19 |
procedure P3 (I : Out Integer) is |
| 20 |
begin |
| 21 |
null; |
| 22 |
end; |
| 23 |
|
| 24 |
begin |
| 25 |
|
| 26 |
Counter1 := Int(Counter2); |
| 27 |
Counter2 := Integer(Counter1); |
| 28 |
|
| 29 |
Temp := Integer(Counter1); |
| 30 |
Counter1 := Int(Temp); |
| 31 |
|
| 32 |
Temp := Counter2; |
| 33 |
Counter2 := Temp; |
| 34 |
|
| 35 |
Temp := Integer (Counter1) + Counter2; |
| 36 |
|
| 37 |
if Counter1 /= Int (Counter2) then |
| 38 |
raise Program_Error; |
| 39 |
end if; |
| 40 |
|
| 41 |
Temp := F(Integer (Counter1)); |
| 42 |
Counter1 := Int(F(Temp)); |
| 43 |
|
| 44 |
Temp := F(Counter2); |
| 45 |
Counter2 := F(Temp); |
| 46 |
|
| 47 |
Temp := F2; |
| 48 |
P3 (Counter2); |
| 49 |
|
| 50 |
end; |
| 51 |
|
| 52 |
-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&vfa1_pkg__counter1" 6 "gimple"} } |
| 53 |
-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&vfa1_pkg__counter2" 5 "gimple"} } |
| 54 |
-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&temp" 0 "gimple"} } |
| 55 |
|
| 56 |
-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&vfa1_pkg__counter1" 3 "gimple"} } |
| 57 |
-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&vfa1_pkg__counter2" 4 "gimple"} } |
| 58 |
-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&temp" 0 "gimple"} } |
| 59 |
|