summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gnat.dg/volatile9.adb
blob: 52b55aee23afd3983c315950112705812d7d26a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- { dg-do compile }
-- { dg-options "-O2 -fdump-tree-optimized" }

function Volatile9 return Integer is

   type A is array (1..4) of Integer;
   pragma Volatile_Components (A);

   V : A := (others => 0);

begin
   for J in 1 .. 10 loop
      V(1) := V(1) + 1;
   end loop;

   return V(1);
end;

-- { dg-final { scan-tree-dump "goto" "optimized" } }
-- { dg-final { cleanup-tree-dump "optimized" } }
OpenPOWER on IntegriCloud