From: charlet Date: Sun, 16 Oct 2011 12:12:11 +0000 (+0000) Subject: 2011-10-16 Tristan Gingold X-Git-Tag: upstream/4.9.2~17039 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce9ee49d2baa5069a210098011f65f1e99a1a6fe;p=platform%2Fupstream%2Flinaro-gcc.git 2011-10-16 Tristan Gingold * link.c (_AIX): Add support for GNU ld. 2011-10-16 Fedor Rybin * gnat_ugn.texi: Fixing gnattest example names in the doc. Adding explanation to additional tests usage. 2011-10-16 Robert Dewar * exp_ch6.adb, sem_ch6.adb: Minor reformatting. 2011-10-16 Eric Botcazou * a-convec.adb: Fix minor inconsistencies. 2011-10-16 Matthew Heaney * a-cusyqu.ads, a-cbsyqu.ads, a-cuprqu.ads, a-cbprqu.ads (package Implementation): Specify pragma Implementation_Defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180056 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ac9e221..9c17e0e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,25 @@ +2011-10-16 Tristan Gingold + + * link.c (_AIX): Add support for GNU ld. + +2011-10-16 Fedor Rybin + + * gnat_ugn.texi: Fixing gnattest example names in the doc. + Adding explanation to additional tests usage. + +2011-10-16 Robert Dewar + + * exp_ch6.adb, sem_ch6.adb: Minor reformatting. + +2011-10-16 Eric Botcazou + + * a-convec.adb: Fix minor inconsistencies. + +2011-10-16 Matthew Heaney + + * a-cusyqu.ads, a-cbsyqu.ads, a-cuprqu.ads, a-cbprqu.ads (package + Implementation): Specify pragma Implementation_Defined. + 2011-10-15 Nicolas Roche * gcc-interface/lang-specs.h: Ensure -mrtp switch is passed when using diff --git a/gcc/ada/a-cbprqu.ads b/gcc/ada/a-cbprqu.ads index d8a53f2..aa184a1 100644 --- a/gcc/ada/a-cbprqu.ads +++ b/gcc/ada/a-cbprqu.ads @@ -54,11 +54,11 @@ generic package Ada.Containers.Bounded_Priority_Queues is pragma Preelaborate; - -- All identifiers in this unit are implementation defined + package Implementation is - pragma Implementation_Defined; + -- All identifiers in this unit are implementation defined - package Implementation is + pragma Implementation_Defined; type List_Type (Capacity : Count_Type) is tagged limited private; diff --git a/gcc/ada/a-cbsyqu.ads b/gcc/ada/a-cbsyqu.ads index 17b0a5a..0d6e3c3 100644 --- a/gcc/ada/a-cbsyqu.ads +++ b/gcc/ada/a-cbsyqu.ads @@ -44,11 +44,11 @@ generic package Ada.Containers.Bounded_Synchronized_Queues is pragma Preelaborate; - -- All identifiers in this unit are implementation defined + package Implementation is - pragma Implementation_Defined; + -- All identifiers in this unit are implementation defined - package Implementation is + pragma Implementation_Defined; type List_Type (Capacity : Count_Type) is tagged limited private; diff --git a/gcc/ada/a-convec.adb b/gcc/ada/a-convec.adb index 0fd8dee..a57f7fb 100644 --- a/gcc/ada/a-convec.adb +++ b/gcc/ada/a-convec.adb @@ -802,7 +802,7 @@ package body Ada.Containers.Vectors is if Is_Empty (Object.Container.all) then return No_Element; else - return Cursor'(Object.Container, Index_Type'First); + return (Object.Container, Index_Type'First); end if; end First; @@ -1517,7 +1517,7 @@ package body Ada.Containers.Vectors is Insert (Container, Index, New_Item); - Position := Cursor'(Container'Unchecked_Access, Index); + Position := (Container'Unchecked_Access, Index); end Insert; procedure Insert @@ -1600,7 +1600,7 @@ package body Ada.Containers.Vectors is Insert (Container, Index, New_Item, Count); - Position := Cursor'(Container'Unchecked_Access, Index); + Position := (Container'Unchecked_Access, Index); end Insert; procedure Insert @@ -2017,7 +2017,7 @@ package body Ada.Containers.Vectors is Insert_Space (Container, Index, Count => Count); - Position := Cursor'(Container'Unchecked_Access, Index); + Position := (Container'Unchecked_Access, Index); end Insert_Space; -------------- @@ -2093,7 +2093,7 @@ package body Ada.Containers.Vectors is if Is_Empty (Object.Container.all) then return No_Element; else - return Cursor'(Object.Container, Object.Container.Last); + return (Object.Container, Object.Container.Last); end if; end Last; @@ -2406,7 +2406,7 @@ package body Ada.Containers.Vectors is return Constant_Reference_Type is begin - if (Position) > Container.Last then + if Position > Container.Last then raise Constraint_Error with "Index is out of range"; else return (Element => Container.Elements.EA (Position)'Access); @@ -3009,7 +3009,7 @@ package body Ada.Containers.Vectors is if Index not in Index_Type'First .. Container.Last then return No_Element; else - return Cursor'(Container'Unchecked_Access, Index); + return (Container'Unchecked_Access, Index); end if; end To_Cursor; diff --git a/gcc/ada/a-cuprqu.ads b/gcc/ada/a-cuprqu.ads index f7d4d4c..3709f42 100644 --- a/gcc/ada/a-cuprqu.ads +++ b/gcc/ada/a-cuprqu.ads @@ -52,11 +52,11 @@ generic package Ada.Containers.Unbounded_Priority_Queues is pragma Preelaborate; - -- All identifiers in this unit are implementation defined + package Implementation is - pragma Implementation_Defined; + -- All identifiers in this unit are implementation defined - package Implementation is + pragma Implementation_Defined; type List_Type is tagged limited private; diff --git a/gcc/ada/a-cusyqu.ads b/gcc/ada/a-cusyqu.ads index 20e584d..c4f9d7f 100644 --- a/gcc/ada/a-cusyqu.ads +++ b/gcc/ada/a-cusyqu.ads @@ -44,11 +44,11 @@ generic package Ada.Containers.Unbounded_Synchronized_Queues is pragma Preelaborate; - -- All identifiers in this unit are implementation defined + package Implementation is - pragma Implementation_Defined; + -- All identifiers in this unit are implementation defined - package Implementation is + pragma Implementation_Defined; type List_Type is tagged limited private; diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 17b72cf..993fa40 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -311,11 +311,11 @@ package body Exp_Ch6 is Add_Extra_Actual_To_Call (Function_Call, Alloc_Form_Formal, Alloc_Form_Actual); - -- Pass the Storage_Pool parameter. This parameter is omitted + -- Pass the Storage_Pool parameter. This parameter is omitted on -- .NET/JVM/ZFP as those targets do not support pools. - if - VM_Target = No_VM and then RTE_Available (RE_Root_Storage_Pool_Ptr) + if VM_Target = No_VM + and then RTE_Available (RE_Root_Storage_Pool_Ptr) then Pool_Formal := Build_In_Place_Formal (Function_Id, BIP_Storage_Pool); Analyze_And_Resolve (Pool_Actual, Etype (Pool_Formal)); @@ -5246,8 +5246,8 @@ package body Exp_Ch6 is -- pool parameter on .NET/JVM/ZFP because the parameter -- is not created in the first place. - if VM_Target = No_VM and then - RTE_Available (RE_Root_Storage_Pool_Ptr) + if VM_Target = No_VM + and then RTE_Available (RE_Root_Storage_Pool_Ptr) then Pool_Decl := Make_Object_Renaming_Declaration (Loc, diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 7099425..7e9b243 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -17878,13 +17878,13 @@ Let's take a very simple example using the first @command{gnattest} example located at @smallexample -/share/examples/gnattest/lib1 +/share/examples/gnattest/simple @end smallexample This project contains a simple package containing one subprogram. By running gnattest @smallexample -$ gnattest --harness-dir=driver -Plib1.gpr +$ gnattest --harness-dir=driver -Psimple.gpr @end smallexample a test driver is created in dir "driver". It can be compiled and run: @@ -17896,18 +17896,18 @@ $ test_runner @end smallexample One failed test with diagnosis "test not implemented" is reported. -Since no special output option was specified the test package Lib1.Tests +Since no special output option was specified the test package Simple.Tests is located in @smallexample -/share/examples/gnattest/lib1/src/tests +/share/examples/gnattest/simple/src/tests @end smallexample For each package containing visible subprograms, a child test package is generated. It contains one test routine per tested subprogram. Each declaration of test subprogram has a comment specifying to which tested subprogram it corresponds. All the test routines have separated bodies. -The test routine locates at lib1-tests-test_inc_5eaee3.adb has a single +The test routine locates at simple-tests-test_inc_5eaee3.adb has a single statement - procedure Assert. It has two arguments: the boolean expression which we want to check and the diagnosis message to display if the condition is false. @@ -17945,11 +17945,11 @@ names and order of its parameters are the same, the old test routine will fit in it's place and no test stub will be generated for this subprogram. This can be demonstrated with the previous example. By uncommenting declaration -and body of function Dec in lib1.ads and lib1.adb, running +and body of function Dec in simple.ads and simple.adb, running @command{gnattest} on the project and then running the test driver: @smallexample -gnattest --harness-dir=driver -Plib1.gpr +gnattest --harness-dir=driver -Psimple.gpr cd driver gprbuild -Ptest_driver test_runner @@ -18001,15 +18001,15 @@ are already written so no need to worry if the tool reports that 0 new stubs were generated). @smallexample -cd examples/lib2 -gnattest --harness-dir=driver -Plib2.gpr +cd /share/examples/gnattest/tagged_rec +gnattest --harness-dir=driver -Ptagged_rec.gpr @end smallexample Taking a closer look at the test type declared in the test package Speed1.Controller_Tests is necessary. It is declared in @smallexample -examples/lib2/src/tests +/share/examples/gnattest/tagged_rec/src/tests @end smallexample Test types are direct or indirect descendants of @@ -18045,7 +18045,7 @@ shown by running the test driver generated for second example. As previously mentioned, actual tests are already written for this example. @smallexample -cd examples/lib2/driver +cd driver gprbuild -Ptest_driver test_runner @end smallexample @@ -18084,7 +18084,7 @@ overridden parent tests against objects of the type which have overriding primitives. @smallexample -gnattest --harness-dir=driver --liskov -Plib2.gpr +gnattest --harness-dir=driver --liskov -Ptagged_rec.gpr cd driver gprbuild -Ptest_driver test_runner @@ -18108,8 +18108,8 @@ either count for Nominal mode or do not for Robustness mode). The third example demonstrates how it works: @smallexample -cd examples/lib3 -gnattest --harness-dir=driver -Plib3.gpr +cd /share/examples/gnattest/contracts +gnattest --harness-dir=driver -Pcontracts.gpr @end smallexample Putting actual checks within the range of the contract does not cause any @@ -18144,10 +18144,37 @@ the same way. @section Additional Tests @noindent -@command{gnattest} can add already existing testing code to the driver along -with new stubs. This solves the legacy problem: no need to rewrite all the -tests. The only thing required is a project file that has all the desired -test units (and all their dependencies) as it's source files. +@command{gnattest} can add user written tests to the main suite of the test +driver. @command{gnattest} traverses given packages and searches for test +routines. All procedures with a single in out parameter of a type which is +a derivation of AUnit.Test_Fixtures.Test_Fixture declared in package +specifications are added to the suites and then are executed by test driver. +(Set_Up and Tear_Down are filtered out). + +An example illustrates two ways of crating test harness for user written tests. +Directory additional contains a AUnit based test driver written by hand. + +@smallexample +/share/examples/gnattest/additional_tests/ +@end smallexample + +To create a test driver for already written tests use --harness-only option: + +@smallexample +gnattest -Padditional/harness/harness.gpr --harness-dir=harness_only \ + --harness-only +gnatmake -Pharness_only/test_driver.gpr +harness_only/test_runner +@end smallexample + +Additional tests can also be executed together withgenerated tests: + +@smallexample +gnattest -Psimple.gpr --additional-tests=additional/harness/harness.gpr \ + --harness-dir=mixing +gnatmake -Pmixing/test_driver.gpr +mixing/test_runner +@end smallexample @node Current Limitations @section Current Limitations diff --git a/gcc/ada/link.c b/gcc/ada/link.c index bf5d584..8bcad27 100644 --- a/gcc/ada/link.c +++ b/gcc/ada/link.c @@ -152,18 +152,6 @@ const char *__gnat_object_library_extension = ".a"; unsigned char __gnat_separate_run_path_options = 0; const char *__gnat_default_libgcc_subdir = "lib"; -#elif defined (_AIX) -const char *__gnat_object_file_option = "-Wl,-f,"; -const char *__gnat_run_path_option = ""; -int __gnat_link_max = 15000; -const unsigned char __gnat_objlist_file_supported = 1; -char __gnat_shared_libgnat_default = STATIC; -char __gnat_shared_libgcc_default = STATIC; -unsigned char __gnat_using_gnu_linker = 0; -const char *__gnat_object_library_extension = ".a"; -unsigned char __gnat_separate_run_path_options = 0; -const char *__gnat_default_libgcc_subdir = "lib"; - #elif defined (__FreeBSD__) const char *__gnat_object_file_option = ""; const char *__gnat_run_path_option = "-Wl,-rpath,"; @@ -204,12 +192,27 @@ const char *__gnat_default_libgcc_subdir = "lib64"; const char *__gnat_default_libgcc_subdir = "lib"; #endif +#elif defined (_AIX) +/* On AIX, even when with GNU ld we use native linker switches. This is + particularly important for '-f' as it should be interpreted by collect2. */ + +const char *__gnat_object_file_option = "-Wl,-f,"; +const char *__gnat_run_path_option = ""; +char __gnat_shared_libgnat_default = STATIC; +char __gnat_shared_libgcc_default = STATIC; +int __gnat_link_max = 15000; +const unsigned char __gnat_objlist_file_supported = 1; +unsigned char __gnat_using_gnu_linker = 0; +const char *__gnat_object_library_extension = ".a"; +unsigned char __gnat_separate_run_path_options = 0; +const char *__gnat_default_libgcc_subdir = "lib"; + #elif (HAVE_GNU_LD) /* These are the settings for all systems that use gnu ld. GNU style response file is supported, the shared library default is STATIC. */ -const char *__gnat_run_path_option = ""; const char *__gnat_object_file_option = ""; +const char *__gnat_run_path_option = ""; char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgcc_default = STATIC; int __gnat_link_max = 8192; diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 6cf630a..3dbf782 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -6490,8 +6490,8 @@ package body Sem_Ch6 is -- use a user-defined pool. This formal is not added on -- .NET/JVM/ZFP as those targets do not support pools. - if VM_Target = No_VM and then - RTE_Available (RE_Root_Storage_Pool_Ptr) + if VM_Target = No_VM + and then RTE_Available (RE_Root_Storage_Pool_Ptr) then Discard := Add_Extra_Formal