Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gnat.dg / memorytest.adb
blobffc33864e657aadfb4af68431f465c0906313693
1 -- { dg-do run }
3 with Interfaces.C; use Interfaces.C;
4 with Interfaces.C.Strings; use Interfaces.C.Strings;
5 with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
7 procedure memorytest is
9 function malloc (size: size_t) return chars_ptr;
10 pragma Import (C, malloc);
12 C : chars_ptr;
14 begin
15 -- Allocate a string in C ...
16 C := malloc (1000);
17 -- ... and free it with the GNAT runtime
18 Free (C);
20 -- now allocate something completely unrelated and free it
21 declare
22 A2 : Unbounded_String := To_Unbounded_String ("hello");
23 begin
24 null;
25 end;
26 end;