aboutsummaryrefslogtreecommitdiffstats
path: root/test/FrontendAda/negative_field_offset.adb
blob: f8b85108504dbe7530f6405aa0ffa04c925196c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- RUN: %llvmgcc -c %s
with System;
procedure Negative_Field_Offset (N : Integer) is
   type String_Pointer is access String;
   --  Force use of a thin pointer.
   for String_Pointer'Size use System.Word_Size;
   P : String_Pointer;

   procedure Q (P : String_Pointer) is
   begin
      P (1) := 'Z';
   end;
begin
   P := new String (1 .. N);
   Q (P);
end;