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