Commit 2fe2920e by Arnaud Charlet

[multiple changes]

2012-11-06  Robert Dewar  <dewar@adacore.com>

	* exp_prag.adb, impunit.adb, exp_ch9.adb, par-ch4.adb,
	s-tarest.adb: Minor reformatting.

2012-11-06  Tristan Gingold  <gingold@adacore.com>

	* s-tposen.ads: Minor comment update.

2012-11-06  Arnaud Charlet  <charlet@adacore.com>

	* sysdep.c: Rename sig* wrappers to use unique names.

2012-11-06  Yannick Moy  <moy@adacore.com>

	* exp_dbug.adb (Qualify_Entity_Name): Mark entity as having a qualified
	name after being treated, in formal verification mode.

2012-11-06  Fedor Rybin  <frybin@adacore.com>

	* gnat_ugn.texi: Updating gnattest section to reflect changes
	in default behaviour of the tool.

From-SVN: r193215
parent 6bc057a7
2012-11-06 Robert Dewar <dewar@adacore.com>
* exp_prag.adb, impunit.adb, exp_ch9.adb, par-ch4.adb,
s-tarest.adb: Minor reformatting.
2012-11-06 Tristan Gingold <gingold@adacore.com>
* s-tposen.ads: Minor comment update.
2012-11-06 Arnaud Charlet <charlet@adacore.com>
* sysdep.c: Rename sig* wrappers to use unique names.
2012-11-06 Yannick Moy <moy@adacore.com>
* exp_dbug.adb (Qualify_Entity_Name): Mark entity as having a qualified
name after being treated, in formal verification mode.
2012-11-06 Fedor Rybin <frybin@adacore.com>
* gnat_ugn.texi: Updating gnattest section to reflect changes
in default behaviour of the tool.
2012-11-06 Thomas Quinot <quinot@adacore.com> 2012-11-06 Thomas Quinot <quinot@adacore.com>
* s-oscons-tmplt.c: Interfaces.C now needs to be WITH'd even * s-oscons-tmplt.c: Interfaces.C now needs to be WITH'd even
......
...@@ -14021,6 +14021,7 @@ package body Exp_Ch9 is ...@@ -14021,6 +14021,7 @@ package body Exp_Ch9 is
declare declare
Create_RE : RE_Id; Create_RE : RE_Id;
begin begin
if Restricted_Profile then if Restricted_Profile then
if Partition_Elaboration_Policy = 'S' then if Partition_Elaboration_Policy = 'S' then
...@@ -14031,6 +14032,7 @@ package body Exp_Ch9 is ...@@ -14031,6 +14032,7 @@ package body Exp_Ch9 is
else else
Create_RE := RE_Create_Task; Create_RE := RE_Create_Task;
end if; end if;
Name := New_Reference_To (RTE (Create_RE), Loc); Name := New_Reference_To (RTE (Create_RE), Loc);
end; end;
......
...@@ -1307,12 +1307,13 @@ package body Exp_Dbug is ...@@ -1307,12 +1307,13 @@ package body Exp_Dbug is
if Has_Qualified_Name (Ent) then if Has_Qualified_Name (Ent) then
return; return;
-- In formal verification mode, simply append a suffix for homonyms, but -- In formal verification mode, simply append a suffix for homonyms.
-- do not mark the name as being qualified. We used to qualify entity -- We used to qualify entity names as full expansion does, but this was
-- names as full expansion does, but this was removed as this prevents -- removed as this prevents the verification back-end from using a short
-- the verification back-end from using a short name for debugging and -- name for debugging and user interaction. The verification back-end
-- user interaction. The verification back-end already takes care of -- already takes care of qualifying names when needed. Still mark the
-- qualifying names when needed. -- name as being qualified, as Qualify_Entity_Name may be called more
-- than once on the same entity.
elsif Alfa_Mode then elsif Alfa_Mode then
if Has_Homonym (Ent) then if Has_Homonym (Ent) then
...@@ -1322,6 +1323,7 @@ package body Exp_Dbug is ...@@ -1322,6 +1323,7 @@ package body Exp_Dbug is
Set_Chars (Ent, Name_Enter); Set_Chars (Ent, Name_Enter);
end if; end if;
Set_Has_Qualified_Name (Ent);
return; return;
-- If the entity is a variable encoding the debug name for an object -- If the entity is a variable encoding the debug name for an object
......
...@@ -819,20 +819,20 @@ package body Exp_Prag is ...@@ -819,20 +819,20 @@ package body Exp_Prag is
-- Old_1 : <type of Incr_Expr>; -- Old_1 : <type of Incr_Expr>;
-- Old_2 : <type of Decr_Expr>; -- Old_2 : <type of Decr_Expr>;
-- Flag : Boolean := False; -- Flag : Boolean := False;
--
-- for | while ... loop -- for | while ... loop
-- <preceding source statements> -- <preceding source statements>
--
-- pragma Assert (<Invar_Expr>); -- pragma Assert (<Invar_Expr>);
--
-- if Flag then -- if Flag then
-- Old_1 := Curr_1; -- Old_1 := Curr_1;
-- Old_2 := Curr_2; -- Old_2 := Curr_2;
-- end if; -- end if;
--
-- Curr_1 := <Incr_Expr>; -- Curr_1 := <Incr_Expr>;
-- Curr_2 := <Decr_Expr>; -- Curr_2 := <Decr_Expr>;
--
-- if Flag then -- if Flag then
-- if Curr_1 /= Old_1 then -- if Curr_1 /= Old_1 then
-- pragma Assert (Curr_1 > Old_1); -- pragma Assert (Curr_1 > Old_1);
...@@ -842,7 +842,7 @@ package body Exp_Prag is ...@@ -842,7 +842,7 @@ package body Exp_Prag is
-- else -- else
-- Flag := True; -- Flag := True;
-- end if; -- end if;
--
-- <succeeding source statements> -- <succeeding source statements>
-- end loop; -- end loop;
...@@ -886,7 +886,8 @@ package body Exp_Prag is ...@@ -886,7 +886,8 @@ package body Exp_Prag is
Make_Op_Gt (Loc, Make_Op_Gt (Loc,
Left_Opnd => Curr_Val, Left_Opnd => Curr_Val,
Right_Opnd => Old_Val); Right_Opnd => Old_Val);
else
else pragma Assert (Chars (Arg) = Name_Decreases);
return return
Make_Op_Lt (Loc, Make_Op_Lt (Loc,
Left_Opnd => Curr_Val, Left_Opnd => Curr_Val,
...@@ -956,13 +957,11 @@ package body Exp_Prag is ...@@ -956,13 +957,11 @@ package body Exp_Prag is
Object_Definition => Object_Definition =>
New_Reference_To (Etype (Expr), Loop_Loc))); New_Reference_To (Etype (Expr), Loop_Loc)));
-- Restore the original scope after all temporaries have been -- Restore original scope after all temporaries have been analyzed
-- analyzed.
Pop_Scope; Pop_Scope;
-- Step 3: Store the value of the expression from the previous -- Step 3: Store value of the expression from the previous iteration
-- iteration.
if No (Old_Assign) then if No (Old_Assign) then
Old_Assign := New_List; Old_Assign := New_List;
...@@ -990,8 +989,7 @@ package body Exp_Prag is ...@@ -990,8 +989,7 @@ package body Exp_Prag is
Name => New_Reference_To (Curr_Id, Loc), Name => New_Reference_To (Curr_Id, Loc),
Expression => Relocate_Node (Expr))); Expression => Relocate_Node (Expr)));
-- Step 5: Create the corresponding assertion to verify the change of -- Step 5: Create corresponding assertion to verify change of value
-- value.
-- Generate: -- Generate:
-- pragma Assert (Curr <|> Old); -- pragma Assert (Curr <|> Old);
...@@ -1137,6 +1135,8 @@ package body Exp_Prag is ...@@ -1137,6 +1135,8 @@ package body Exp_Prag is
Expression => New_Reference_To (Standard_True, Loc))))); Expression => New_Reference_To (Standard_True, Loc)))));
end if; end if;
-- Need a comment on this final rewrite ???
Rewrite (N, Make_Null_Statement (Loc)); Rewrite (N, Make_Null_Statement (Loc));
Analyze (N); Analyze (N);
end Expand_Pragma_Loop_Assertion; end Expand_Pragma_Loop_Assertion;
......
...@@ -18348,6 +18348,22 @@ specifies the directory that will hold the harness packages and project file ...@@ -18348,6 +18348,22 @@ specifies the directory that will hold the harness packages and project file
for the test driver. If the @var{dirname} is a relative path, it is considered for the test driver. If the @var{dirname} is a relative path, it is considered
relative to the object directory of the project file. relative to the object directory of the project file.
@item --separates
@cindex @option{--separates} (@command{gnattest})
Bodies of all test routines are generated as separates. This option is
temporarily provided for compatibility to support the old way of generating test
skeletons. Its usage is not recommended because at some point the option will be
abandoned together with this way of generating test packages.
@item --transition
@cindex @option{--transition} (@command{gnattest})
This allows transition from separate test routines to monolith test packages.
All matching test routines are overwritten with contents of corresponding
separates. Note that if separate test routines had any manually added with
clauses they will be moved to the test package body as is and have to be moved
by hand.
@end table @end table
@option{--tests_root}, @option{--subdir} and @option{--tests-dir} switches are @option{--tests_root}, @option{--subdir} and @option{--tests-dir} switches are
...@@ -18432,8 +18448,11 @@ is located in: ...@@ -18432,8 +18448,11 @@ is located in:
For each package containing visible subprograms, a child test package is For each package containing visible subprograms, a child test package is
generated. It contains one test routine per tested subprogram. Each generated. It contains one test routine per tested subprogram. Each
declaration of a test subprogram has a comment specifying which tested declaration of a test subprogram has a comment specifying which tested
subprogram it corresponds to. All of the test routines have separate bodies. subprogram it corresponds to. Bodies of test routines are placed in test package
The test routine located at simple-test_data-tests-test_inc_5eaee3.adb contains bodies and are surrounded by special comment sections. Those comment sections
should not be removed or modified in order for gnattest to be able to regenerate
test packages and keep already written tests in place.
The test routine Test_Inc_5eaee3 located at simple-test_data-tests.adb contains
a single statement: a call to procedure Assert. It has two arguments: a single statement: a call to procedure Assert. It has two arguments:
the Boolean expression we want to check and the diagnosis message to display if the Boolean expression we want to check and the diagnosis message to display if
the condition is false. the condition is false.
...@@ -18469,8 +18488,9 @@ values can be set by Set_Up routine and used in test routines afterwards. ...@@ -18469,8 +18488,9 @@ values can be set by Set_Up routine and used in test routines afterwards.
Bodies of test routines and test_data packages are never overridden after they Bodies of test routines and test_data packages are never overridden after they
have been created once. As long as the name of the subprogram, full expanded Ada have been created once. As long as the name of the subprogram, full expanded Ada
names, and the order of its parameters is the same, the old test routine will names, and the order of its parameters is the same, and comment sections are
fit in its place and no test skeleton will be generated for the subprogram. intact the old test routine will fit in its place and no test skeleton will be
generated for the subprogram.
This can be demonstrated with the previous example. By uncommenting declaration This can be demonstrated with the previous example. By uncommenting declaration
and body of function Dec in simple.ads and simple.adb, running and body of function Dec in simple.ads and simple.adb, running
...@@ -18487,7 +18507,7 @@ the old test is not replaced with a stub, nor is it lost, but a new test ...@@ -18487,7 +18507,7 @@ the old test is not replaced with a stub, nor is it lost, but a new test
skeleton is created for function Dec. skeleton is created for function Dec.
The only way of regenerating tests skeletons is to remove the previously created The only way of regenerating tests skeletons is to remove the previously created
tests. tests together with corresponding comment sections.
@node Default Test Behavior @node Default Test Behavior
@section Default Test Behavior @section Default Test Behavior
...@@ -18615,7 +18635,7 @@ Gnattest has a special option to run overridden parent tests against objects ...@@ -18615,7 +18635,7 @@ Gnattest has a special option to run overridden parent tests against objects
of the type which have overriding primitives: of the type which have overriding primitives:
@smallexample @smallexample
gnattest --harness-dir=driver --liskov -Ptagged_rec.gpr gnattest --harness-dir=driver --validate-type-extensions -Ptagged_rec.gpr
cd driver cd driver
gprbuild -Ptest_driver gprbuild -Ptest_driver
test_runner test_runner
...@@ -663,11 +663,14 @@ package body Impunit is ...@@ -663,11 +663,14 @@ package body Impunit is
return Not_Predefined_Unit; return Not_Predefined_Unit;
end if; end if;
-- Not predefined if file name does not end in .ads or .adb. This can -- To be considered predefined, the file name must end in .ads or .adb.
-- happen when non-standard file names are being used. Calling this -- File names with other extensions (coming from the use of non-standard
-- function on a .adb file is used in GNATprove to detect when a -- file naming schemes) can never be predefined.
-- construct comes from an instance of a generic defined in a predefined
-- unit. -- Note that in the context of a compiler, the .adb case will never
-- arise. However it can arise for other tools, e.g. gnatprove uses
-- this routine to detect when a construct comes from an instance of
-- a generic defined in a predefined unit.
if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads"
and then and then
......
...@@ -2359,11 +2359,14 @@ package body Ch4 is ...@@ -2359,11 +2359,14 @@ package body Ch4 is
-- Error recovery: can raise Error_Resync -- Error recovery: can raise Error_Resync
function P_Primary return Node_Id is function P_Primary return Node_Id is
Lparen : constant Boolean := Prev_Token = Tok_Left_Paren;
Scan_State : Saved_Scan_State; Scan_State : Saved_Scan_State;
Node1 : Node_Id; Node1 : Node_Id;
Lparen : constant Boolean := Prev_Token = Tok_Left_Paren;
-- Remember if previous token is a left parenthesis. This is used to
-- deal with checking whether IF/CASE/FOR expressions appearing as
-- primaries require extra parenthesization.
begin begin
-- The loop runs more than once only if misplaced pragmas are found -- The loop runs more than once only if misplaced pragmas are found
-- or if a misplaced unary minus is skipped. -- or if a misplaced unary minus is skipped.
...@@ -2537,7 +2540,6 @@ package body Ch4 is ...@@ -2537,7 +2540,6 @@ package body Ch4 is
-- For [all | some] indicates a quantified expression -- For [all | some] indicates a quantified expression
when Tok_For => when Tok_For =>
if Token_Is_At_Start_Of_Line then if Token_Is_At_Start_Of_Line then
Error_Msg_AP ("misplaced loop"); Error_Msg_AP ("misplaced loop");
return Error; return Error;
...@@ -2553,10 +2555,9 @@ package body Ch4 is ...@@ -2553,10 +2555,9 @@ package body Ch4 is
return Node1; return Node1;
else
-- Otherwise treat as misused identifier -- Otherwise treat as misused identifier
else
return P_Identifier; return P_Identifier;
end if; end if;
......
...@@ -618,11 +618,12 @@ package body System.Tasking.Restricted.Stages is ...@@ -618,11 +618,12 @@ package body System.Tasking.Restricted.Stages is
Elaborated : Access_Boolean; Elaborated : Access_Boolean;
Chain : in out Activation_Chain; Chain : in out Activation_Chain;
Task_Image : String; Task_Image : String;
Created_Task : Task_Id) is Created_Task : Task_Id)
is
begin begin
Create_Restricted_Task (Priority, Stack_Address, Size, Task_Info, Create_Restricted_Task
CPU, State, Discriminants, Elaborated, (Priority, Stack_Address, Size, Task_Info, CPU, State,
Task_Image, Created_Task); Discriminants, Elaborated, Task_Image, Created_Task);
-- Append this task to the activation chain -- Append this task to the activation chain
......
...@@ -163,7 +163,6 @@ package System.Tasking.Protected_Objects.Single_Entry is ...@@ -163,7 +163,6 @@ package System.Tasking.Protected_Objects.Single_Entry is
-- procedure _clean is -- procedure _clean is
-- begin -- begin
-- service_entry (_object._object'unchecked_access); -- service_entry (_object._object'unchecked_access);
-- unlock_entry (_object._object'unchecked_access);
-- return; -- return;
-- end _clean; -- end _clean;
-- begin -- begin
......
...@@ -933,47 +933,35 @@ __gnat_is_file_not_found_error (int errno_val) { ...@@ -933,47 +933,35 @@ __gnat_is_file_not_found_error (int errno_val) {
/* Provide extern symbols for sig* as needed by the tasking run-time, instead /* Provide extern symbols for sig* as needed by the tasking run-time, instead
of static inline functions. */ of static inline functions. */
#define sigismember android_sigismember
#define sigaddset android_sigaddset
#define sigdelset android_sigdelset
#define sigemptyset android_sigemptyset
#define sigfillset android_sigfillset
#include <signal.h> #include <signal.h>
#undef sigismember
#undef sigaddset
#undef sigdelset
#undef sigemptyset
#undef sigfillset
int int
sigismember (sigset_t *set, int signum) _sigismember (sigset_t *set, int signum)
{ {
return android_sigismember (set, signum); return sigismember (set, signum);
} }
int int
sigaddset (sigset_t *set, int signum) _sigaddset (sigset_t *set, int signum)
{ {
return android_sigaddset (set, signum); return sigaddset (set, signum);
} }
int int
sigdelset (sigset_t *set, int signum) _sigdelset (sigset_t *set, int signum)
{ {
return android_sigdelset (set, signum); return sigdelset (set, signum);
} }
int int
sigemptyset (sigset_t *set) _sigemptyset (sigset_t *set)
{ {
return android_sigemptyset (set); return sigemptyset (set);
} }
int int
sigfillset(sigset_t *set) _sigfillset(sigset_t *set)
{ {
return android_sigfillset (set); return sigfillset (set);
} }
#endif #endif
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