OSDN Git Service

2010-11-10 Martin Jambor <mjambor@suse.cz>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gnat.dg / test_bip_no_alloc.adb
1 --  { dg-do compile }
2
3 pragma Restrictions (No_Allocators);
4 procedure Test_BIP_No_Alloc is
5
6    type LR (B : Boolean) is limited record
7       X : Integer;
8    end record;
9
10    function FLR return LR is
11    begin
12       --  A return statement in a function with a limited and unconstrained
13       --  result subtype can result in expansion of an allocator for the
14       --  secondary stack, but that should not result in a violation of the
15       --  restriction No_Allocators.
16
17       return (B => False, X => 123);
18    end FLR;
19
20    Obj : LR := FLR;
21
22 begin
23    null;
24 end Test_BIP_No_Alloc;