summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/trampoline1.adb
blob: 065b373f07c73201be079a1c8537ad4052ed81f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- { dg-do compile }
-- { dg-options "-gnatws" }

with System; use System;

procedure Trampoline1 is

  A : Integer;

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

  CA : System.Address := F'Code_Address;

begin
  if CA = System.Null_Address then
    raise Program_Error;
  end if;
end;

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