2016-11-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gnat.dg / test_bip_no_alloc.adb
blob82973147e3a3f136da13d3d6580695a45e8535ff
1 -- { dg-do compile }
3 pragma Restrictions (No_Allocators);
4 procedure Test_BIP_No_Alloc is
6 type LR (B : Boolean) is limited record
7 X : Integer;
8 end record;
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.
17 return (B => False, X => 123);
18 end FLR;
20 Obj : LR := FLR;
22 begin
23 null;
24 end Test_BIP_No_Alloc;