[Ada] Make GNAT.Array_Split a preelaborable unit

Message ID 20180611092308.GA135011@adacore.com
State New
Headers show
Series
  • [Ada] Make GNAT.Array_Split a preelaborable unit
Related show

Commit Message

Pierre-Marie de Rodat June 11, 2018, 9:23 a.m.
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  <kirtchev@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.

Patch

--- 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;