summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/alignment3.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gnat.dg/alignment3.adb')
-rw-r--r--gcc/testsuite/gnat.dg/alignment3.adb35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/alignment3.adb b/gcc/testsuite/gnat.dg/alignment3.adb
new file mode 100644
index 000000000..2776f5b8a
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/alignment3.adb
@@ -0,0 +1,35 @@
+-- { dg-do compile }
+
+with System, Ada.Unchecked_Conversion;
+procedure alignment3 is
+
+ type Value_Type (Is_Short : Boolean) is record
+ case Is_Short is
+ when True => V : Natural;
+ when others => A, B : Natural;
+ end case;
+ end record;
+
+ type Link_Type (Short_Values : Boolean) is record
+ Input, Output : Value_Type (Short_Values);
+ Initialized : Boolean;
+ N_Probes : Natural;
+ end record;
+
+ type Link_Access is access Link_Type;
+
+ type Natural_Access is access all Natural;
+ function To_Natural_Access is
+ new Ada.Unchecked_Conversion (System.Address, Natural_Access);
+
+ Ptr : Natural_Access;
+
+ procedure N_Probes_For (Link : Link_Access) is
+ begin
+ Ptr := To_Natural_Access (Link.N_Probes'address);
+ Ptr := To_Natural_Access (Link.Initialized'address);
+ end;
+
+begin
+ null;
+end;