summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/loop_optimization6.adb
blob: 30f35f6ba9c7e9f112ac62193e2820d35cad9859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
-- { dg-do compile }
-- { dg-options "-O2 -gnatp -fdump-tree-optimized" }

package body Loop_Optimization6 is
  procedure Foo is
  begin
    for I in 1 .. 1_000_000 loop
      A := A + 1;
    end loop;
  end Foo;

  procedure Bar is
  begin
    for J in 1 .. 1_000 loop
      Foo;
    end loop;
  end Bar;

  procedure Main is
  begin
    Bar;
  end;
end Loop_Optimization6;

-- { dg-final { scan-tree-dump-not "goto" "optimized"} }
-- { dg-final { cleanup-tree-dump "optimized" } }