OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gnat.dg/] [pointer_controlled.adb] - Blame information for rev 747

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 696 jeremybenn
-- PR ada/49732
2
-- Testcase by Vorfeed Canal
3
 
4
-- { dg-do compile }
5
-- { dg-options "-gnato" }
6
 
7
with Interfaces.C; use Interfaces.C;
8
with Interfaces.C.Strings; use Interfaces.C.Strings;
9
with Interfaces.C.Pointers;
10
 
11
procedure Pointer_Controlled is
12
 
13
   function Create (Name : String) return size_t is
14
 
15
      type Name_String is new char_array (0 .. Name'Length);
16
      type Name_String_Ptr is access Name_String;
17
      pragma Controlled (Name_String_Ptr);
18
 
19
      Name_Str : constant Name_String_Ptr := new Name_String;
20
      Name_Len : size_t;
21
 
22
   begin
23
      To_C (Name, Name_Str.all, Name_Len);
24
      return 1;
25
   end;
26
 
27
   Test : size_t;
28
 
29
begin
30
   Test := Create("ABC");
31
end;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.