This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Make GNAT.Array_Split a preelaborable unit
- From: Pierre-Marie de Rodat <derodat at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Hristian Kirtchev <kirtchev at adacore dot com>
- Date: Mon, 11 Jun 2018 05:23:08 -0400
- Subject: [Ada] Make GNAT.Array_Split a preelaborable unit
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.
--- 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;