This patch makes GNAT.Array_Split a preelaborable unit. As a result, it can be
withed by other preelaborated untis.

Tested on x86_64-pc-linux-gnu, committed on trunk

2018-06-11  Hristian Kirtchev  <kirtc...@adacore.com>

gcc/ada/

        * libgnat/g-arrspl.ads: Add pragma Preelaborate.

gcc/testsuite/

        * gnat.dg/gnat_array_split1.adb, gnat.dg/gnat_array_split1.ads: New
        testcase.
--- gcc/ada/libgnat/g-arrspl.ads
+++ gcc/ada/libgnat/g-arrspl.ads
@@ -56,6 +56,7 @@ generic
    --  Returns True if Item is found in Set, False otherwise
 
 package GNAT.Array_Split is
+   pragma Preelaborate;
 
    Index_Error : exception;
    --  Raised by all operations below if Index > Field_Count (S)

--- /dev/null
new file mode 100644
+++ gcc/testsuite/gnat.dg/gnat_array_split1.adb
@@ -0,0 +1,5 @@
+--  { dg-do compile }
+
+package body GNAT_Array_Split1 is
+   procedure Dummy is null;
+end GNAT_Array_Split1;

--- /dev/null
new file mode 100644
+++ gcc/testsuite/gnat.dg/gnat_array_split1.ads
@@ -0,0 +1,6 @@
+with GNAT.Array_Split;
+
+package GNAT_Array_Split1 is
+   pragma Preelaborate;
+   procedure Dummy;
+end GNAT_Array_Split1;

Reply via email to