Commit d8be36d2 by Piotr Trojanek Committed by Pierre-Marie de Rodat

[Ada] Keep assertions in internal units enabled for GNATprove

In GNATprove mode the assertion policy is now always enabled, even when
analysing internal units. Otherwise, assertion expressions (e.g.
Default_Initial_Condition) in internal units (e.g. Ada.Text_IO)
disappear in the semantic analysis phase of the frontend and the
GNATprove backend can't see them.

No frontend test provided, because only the GNATprove backend is
affected (and there appear to be no difference in the output with -gnatG
switch, because the expansion of Default_Initial_Condition is not
attached to the AST).

2019-07-04  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* opt.adb (Set_Config_Switches): Keep assertions policy as
	enabled when analysing internal units in GNATprove mode.

From-SVN: r273048
parent a0766a82
2019-07-04 Piotr Trojanek <trojanek@adacore.com>
* opt.adb (Set_Config_Switches): Keep assertions policy as
enabled when analysing internal units in GNATprove mode.
2019-07-04 Arnaud Charlet <charlet@adacore.com> 2019-07-04 Arnaud Charlet <charlet@adacore.com>
* exp_ch4.adb (Expand_Short_Circuit_Operator): Strip * exp_ch4.adb (Expand_Short_Circuit_Operator): Strip
......
...@@ -248,7 +248,13 @@ package body Opt is ...@@ -248,7 +248,13 @@ package body Opt is
SPARK_Mode_Pragma := SPARK_Mode_Pragma_Config; SPARK_Mode_Pragma := SPARK_Mode_Pragma_Config;
else else
if GNAT_Mode_Config then -- In GNATprove mode assertions should be always enabled, even
-- when analysing internal units.
if GNATprove_Mode then
pragma Assert (Assertions_Enabled);
null;
elsif GNAT_Mode_Config then
Assertions_Enabled := Assertions_Enabled_Config; Assertions_Enabled := Assertions_Enabled_Config;
else else
Assertions_Enabled := False; Assertions_Enabled := False;
......
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