Check that accessing a struct field that occurs before the start
authorDuncan Sands <baldrick@free.fr>
Thu, 22 Oct 2009 12:53:25 +0000 (12:53 +0000)
committerDuncan Sands <baldrick@free.fr>
Thu, 22 Oct 2009 12:53:25 +0000 (12:53 +0000)
of the struct (!) works correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84853 91177308-0d34-0410-b5e6-96231b3b80d8

test/FrontendAda/negative_field_offset.adb

index 02e3dac23aff70211cdd7a5a21ed3afc79468af0..f8b85108504dbe7530f6405aa0ffa04c925196c6 100644 (file)
@@ -5,6 +5,12 @@ procedure Negative_Field_Offset (N : Integer) is
    --  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;