aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/trampoline3.adb
blob: 280576624524c18600594eaa1791fc6993ad3e0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- { dg-do compile { target *-*-linux* } }
-- { dg-options "-gnatws" }

procedure Trampoline3 is

  A : Integer;

  type FuncPtr is access function (I : Integer) return Integer;

  function F (I : Integer) return Integer is
  begin
    return A + I;
  end F;

  P : FuncPtr := F'Access;
  I : Integer;

begin
  I := P(0);
end;

-- { dg-final { scan-assembler-not "GNU-stack.*x" } }