Commit 38818659 by Joffrey Huguet Committed by Pierre-Marie de Rodat

[Ada] Add preconditions in Ada.Task_Identification

This patch is needed to check for the Ada RM C.7.1(15) rule in SPARK.

2019-07-04  Joffrey Huguet  <huguet@adacore.com>

gcc/ada/

	* libgnarl/a-taside.ads: Add assertion policy to ignore
	preconditions.
	(Abort_Task, Is_Terminated, Is_Callable): Add preconditions.

From-SVN: r273069
parent 2beb5444
2019-07-04 Joffrey Huguet <huguet@adacore.com>
* libgnarl/a-taside.ads: Add assertion policy to ignore
preconditions.
(Abort_Task, Is_Terminated, Is_Callable): Add preconditions.
2019-07-04 Eric Botcazou <ebotcazou@adacore.com> 2019-07-04 Eric Botcazou <ebotcazou@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst: Fix * doc/gnat_rm/implementation_defined_pragmas.rst: Fix
......
...@@ -33,6 +33,12 @@ ...@@ -33,6 +33,12 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Preconditions in this unit are meant for analysis only, not for run-time
-- checking, so that the expected exceptions are raised.
-- This is enforced by setting the corresponding assertion policy to Ignore.
pragma Assertion_Policy (Pre => Ignore);
with System; with System;
with System.Tasking; with System.Tasking;
...@@ -67,17 +73,20 @@ is ...@@ -67,17 +73,20 @@ is
pragma Inline (Environment_Task); pragma Inline (Environment_Task);
procedure Abort_Task (T : Task_Id) with procedure Abort_Task (T : Task_Id) with
Pre => T /= Null_Task_Id,
Global => null; Global => null;
pragma Inline (Abort_Task); pragma Inline (Abort_Task);
-- Note: parameter is mode IN, not IN OUT, per AI-00101 -- Note: parameter is mode IN, not IN OUT, per AI-00101
function Is_Terminated (T : Task_Id) return Boolean with function Is_Terminated (T : Task_Id) return Boolean with
Volatile_Function, Volatile_Function,
Pre => T /= Null_Task_Id,
Global => Tasking_State; Global => Tasking_State;
pragma Inline (Is_Terminated); pragma Inline (Is_Terminated);
function Is_Callable (T : Task_Id) return Boolean with function Is_Callable (T : Task_Id) return Boolean with
Volatile_Function, Volatile_Function,
Pre => T /= Null_Task_Id,
Global => Tasking_State; Global => Tasking_State;
pragma Inline (Is_Callable); pragma Inline (Is_Callable);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment