1-- { dg-do compile }
2-- { dg-options "-fdump-tree-gimple" }
3
4with Atomic6_Pkg; use Atomic6_Pkg;
5
6procedure Atomic6_4 is
7
8  procedure P (I1 : out Integer; I2 : in Integer) is
9  begin
10    I1 := I2;
11  end;
12
13  Temp : Integer;
14begin
15
16  P (Integer(Counter1), Integer(Counter2));
17
18  P (Timer1, Timer2);
19
20  P (Integer(Counter1), Timer1);
21  P (Timer1, Integer(Counter1));
22
23  P (Temp, Integer(Counter1));
24  P (Integer(Counter1), Temp);
25
26  P (Temp, Timer1);
27  P (Timer1, Temp);
28
29end;
30
31-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&atomic6_pkg__counter1" 2 "gimple"} }
32-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&atomic6_pkg__counter2" 1 "gimple"} }
33-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&atomic6_pkg__timer1" 2 "gimple"} }
34-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&atomic6_pkg__timer2" 1 "gimple"} }
35-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&temp" 0 "gimple"} }
36-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*ptr" 0 "gimple"} }
37
38-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&atomic6_pkg__counter1" 3 "gimple"} }
39-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&atomic6_pkg__counter2" 0 "gimple"} }
40-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&atomic6_pkg__timer1" 3 "gimple"} }
41-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&atomic6_pkg__timer2" 0 "gimple"} }
42-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&temp" 0 "gimple"} }
43-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*ptr" 0 "gimple"} }
44
45