diff --git a/testsuite/ada/nameres.adb b/testsuite/ada/nameres.adb index 58a060d65..1aed83238 100644 --- a/testsuite/ada/nameres.adb +++ b/testsuite/ada/nameres.adb @@ -155,6 +155,11 @@ procedure Nameres is Help => "Only output failures on stdout. Note that this triggers" & " failures logging even when --quiet is passed."); + package No_Abort_On_Failures is new Parse_Flag + (App.Args.Parser, Long => "--no-abort-on-failures", + Help => "Expected name resolution failures: do not call Abort_App" + & " if some name resolution failed"); + package Imprecise_Fallback is new Parse_Flag (App.Args.Parser, Long => "--imprecise-fallback", Help => "Activate fallback mechanism for name resolution"); @@ -1447,7 +1452,8 @@ procedure Nameres is is pragma Unreferenced (Context); - Watermark : GNATCOLL.Memory.Watermark_Info; + Watermark : GNATCOLL.Memory.Watermark_Info; + App_Failed : Boolean := False; begin -- Measure time and memory before post-processing @@ -1469,8 +1475,18 @@ procedure Nameres is end; end if; + for Job of Jobs loop + for File_Stats of Job_Data (Job.ID).Stats.File_Stats loop + App_Failed := App_Failed or File_Stats.Nb_Fails > 0; + end loop; + end loop; + Free (Job_Data); + if App_Failed and then not Args.No_Abort_On_Failures.Get then + Abort_App ("Name resolution failed."); + end if; + Put_Line ("Done."); end App_Post_Process; diff --git a/testsuite/drivers/name_resolution_driver.py b/testsuite/drivers/name_resolution_driver.py index 3077450d2..fc93f5d70 100644 --- a/testsuite/drivers/name_resolution_driver.py +++ b/testsuite/drivers/name_resolution_driver.py @@ -55,6 +55,9 @@ class NameResolutionDriver(BaseDriver): * ``runtime_name``: Name of the runtime to use when loading the project (``--RTS`` nameres switch). + + * ``expect_fail``: Do not abort the nameres application if failures are + expected during resolution. """ perf_supported = True @@ -128,7 +131,7 @@ def run(self): # just on nameres-specific pragmas) and display only error messages, # not traceback (for test output stability). if self.test_env.get("batch"): - args += ["--all", "--no-traceback"] + args += ["--all", "--no-traceback", "--no-abort-on-failures"] # In perf mode, we need nameres not to print anything if not self.perf_mode: @@ -147,6 +150,9 @@ def run(self): if runtime_name: args.append(f"--RTS={runtime_name}") + if self.test_env.get("expect_fail"): + args.append("--no-abort-on-failures") + # Add optional explicit list of sources to process args += input_sources diff --git a/testsuite/tests/misc/auto_provider/foo.adb b/testsuite/tests/misc/auto_provider/foo.adb index 4772bc7a4..f25614824 100644 --- a/testsuite/tests/misc/auto_provider/foo.adb +++ b/testsuite/tests/misc/auto_provider/foo.adb @@ -6,5 +6,5 @@ procedure Foo is pragma Test_Statement; begin Bar; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Foo; diff --git a/testsuite/tests/misc/auto_provider/test.out b/testsuite/tests/misc/auto_provider/test.out index b85d2cec2..bebd37e3d 100644 --- a/testsuite/tests/misc/auto_provider/test.out +++ b/testsuite/tests/misc/auto_provider/test.out @@ -41,6 +41,8 @@ Expr: Resolving xrefs for node *************************************************** +Name resolution failed as expected with: + foo.adb:8:4: error: no such entity 8 | Bar; | ^^^ diff --git a/testsuite/tests/name_resolution/case_stmt_alt_fail/test.yaml b/testsuite/tests/name_resolution/case_stmt_alt_fail/test.yaml index 173e325ff..929bbc6b8 100644 --- a/testsuite/tests/name_resolution/case_stmt_alt_fail/test.yaml +++ b/testsuite/tests/name_resolution/case_stmt_alt_fail/test.yaml @@ -1,2 +1,3 @@ driver: name-resolution input_sources: [test.adb] +expect_fail: true diff --git a/testsuite/tests/name_resolution/if_stmt_alt_fail/test.yaml b/testsuite/tests/name_resolution/if_stmt_alt_fail/test.yaml index 173e325ff..929bbc6b8 100644 --- a/testsuite/tests/name_resolution/if_stmt_alt_fail/test.yaml +++ b/testsuite/tests/name_resolution/if_stmt_alt_fail/test.yaml @@ -1,2 +1,3 @@ driver: name-resolution input_sources: [test.adb] +expect_fail: true diff --git a/testsuite/tests/name_resolution/late_use_clause/test.yaml b/testsuite/tests/name_resolution/late_use_clause/test.yaml index d2e2d085b..afc5167c5 100644 --- a/testsuite/tests/name_resolution/late_use_clause/test.yaml +++ b/testsuite/tests/name_resolution/late_use_clause/test.yaml @@ -1,2 +1,3 @@ driver: name-resolution input_sources: [testuse.adb] +expect_fail: true diff --git a/testsuite/tests/name_resolution/test_expect_fail/test.yaml b/testsuite/tests/name_resolution/test_expect_fail/test.yaml index 173e325ff..929bbc6b8 100644 --- a/testsuite/tests/name_resolution/test_expect_fail/test.yaml +++ b/testsuite/tests/name_resolution/test_expect_fail/test.yaml @@ -1,2 +1,3 @@ driver: name-resolution input_sources: [test.adb] +expect_fail: true diff --git a/testsuite/tests/name_resolution/use_bool_derived_type/test.yaml b/testsuite/tests/name_resolution/use_bool_derived_type/test.yaml index e164dadba..669ec4067 100644 --- a/testsuite/tests/name_resolution/use_bool_derived_type/test.yaml +++ b/testsuite/tests/name_resolution/use_bool_derived_type/test.yaml @@ -1,2 +1,3 @@ driver: name-resolution input_sources: [test_valid.adb, test_invalid.adb, test_task.adb] +expect_fail: true diff --git a/testsuite/tests/semantic_errors/anonymous_types/test.adb b/testsuite/tests/semantic_errors/anonymous_types/test.adb index 6c75fb24e..62c39523e 100644 --- a/testsuite/tests/semantic_errors/anonymous_types/test.adb +++ b/testsuite/tests/semantic_errors/anonymous_types/test.adb @@ -6,11 +6,11 @@ procedure Test is Z : access T'Class; begin X := 2; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); Y := 3; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); Z := 4; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/anonymous_types/test.out b/testsuite/tests/semantic_errors/anonymous_types/test.out index 8d9aa8b4a..ea14edce1 100644 --- a/testsuite/tests/semantic_errors/anonymous_types/test.out +++ b/testsuite/tests/semantic_errors/anonymous_types/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ******************************************************* +Name resolution failed as expected with: + test.adb:8:9: error: expected anonymous access on Integer, got universal integer 8 | X := 2; | ^ @@ -12,6 +14,8 @@ test.adb:8:9: error: expected anonymous access on Integer, got universal integer Resolving xrefs for node ********************************************************* +Name resolution failed as expected with: + test.adb:11:9: error: expected anonymous array type defined at test.adb:5:8, got universal integer 11 | Y := 3; | ^ @@ -20,6 +24,8 @@ test.adb:11:9: error: expected anonymous array type defined at test.adb:5:8, got Resolving xrefs for node ********************************************************* +Name resolution failed as expected with: + test.adb:14:9: error: expected anonymous access on T'Class, got universal integer 14 | Z := 4; | ^ diff --git a/testsuite/tests/semantic_errors/call_function_as_procedure/test.adb b/testsuite/tests/semantic_errors/call_function_as_procedure/test.adb index 22bc9c915..4d993753d 100644 --- a/testsuite/tests/semantic_errors/call_function_as_procedure/test.adb +++ b/testsuite/tests/semantic_errors/call_function_as_procedure/test.adb @@ -2,5 +2,5 @@ procedure Test is function Foo (X : Integer) return Integer is (X); begin Foo (2); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/call_function_as_procedure/test.out b/testsuite/tests/semantic_errors/call_function_as_procedure/test.out index 76b6a3545..7466ad4c0 100644 --- a/testsuite/tests/semantic_errors/call_function_as_procedure/test.out +++ b/testsuite/tests/semantic_errors/call_function_as_procedure/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ***************************************************** +Name resolution failed as expected with: + test.adb:4:4: error: resolution failed 4 | Foo (2); | ^^^^^^^^ diff --git a/testsuite/tests/semantic_errors/case_expr_selector/test.adb b/testsuite/tests/semantic_errors/case_expr_selector/test.adb index 3bff73cf4..e08064368 100644 --- a/testsuite/tests/semantic_errors/case_expr_selector/test.adb +++ b/testsuite/tests/semantic_errors/case_expr_selector/test.adb @@ -6,5 +6,5 @@ begin R := (case Foo (3) is when True => 1, when False => 2); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/complex_binop/test.adb b/testsuite/tests/semantic_errors/complex_binop/test.adb index 99d4f2d76..0101d5431 100644 --- a/testsuite/tests/semantic_errors/complex_binop/test.adb +++ b/testsuite/tests/semantic_errors/complex_binop/test.adb @@ -4,5 +4,5 @@ procedure Test is X : Boolean; begin X := Foo (2 + 2, True); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/complex_binop/test.out b/testsuite/tests/semantic_errors/complex_binop/test.out index 92e25451b..953c55f66 100644 --- a/testsuite/tests/semantic_errors/complex_binop/test.out +++ b/testsuite/tests/semantic_errors/complex_binop/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ******************************************************* +Name resolution failed as expected with: + test.adb:6:9: error: expected Boolean, got Integer 6 | X := Foo (2 + 2, True); | ^^^^^^^^^^^^^^^^^ @@ -16,6 +18,8 @@ Analyzing test_2.adb Resolving xrefs for node ********************************************************* +Name resolution failed as expected with: + test_2.adb:6:25: error: expected Integer, got Boolean 6 | X := Foo (2 + 2, 2 + True); | ^^^^ @@ -28,6 +32,8 @@ Analyzing test_3.adb Resolving xrefs for node ********************************************************* +Name resolution failed as expected with: + test_3.adb:7:9: error: no matching alternative (of 2 candidates) 7 | X := Foo (2 + 2, True); | ^^^ diff --git a/testsuite/tests/semantic_errors/complex_binop/test_2.adb b/testsuite/tests/semantic_errors/complex_binop/test_2.adb index 6b1fb45b4..b22c0457b 100644 --- a/testsuite/tests/semantic_errors/complex_binop/test_2.adb +++ b/testsuite/tests/semantic_errors/complex_binop/test_2.adb @@ -4,5 +4,5 @@ procedure Test is X : Integer; begin X := Foo (2 + 2, 2 + True); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/complex_binop/test_3.adb b/testsuite/tests/semantic_errors/complex_binop/test_3.adb index 999e26868..d60603a7d 100644 --- a/testsuite/tests/semantic_errors/complex_binop/test_3.adb +++ b/testsuite/tests/semantic_errors/complex_binop/test_3.adb @@ -5,6 +5,6 @@ procedure Test is X : Boolean; begin X := Foo (2 + 2, True); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/constraining_field_reference/test.adb b/testsuite/tests/semantic_errors/constraining_field_reference/test.adb index 6b18854ba..43d6d1ec5 100644 --- a/testsuite/tests/semantic_errors/constraining_field_reference/test.adb +++ b/testsuite/tests/semantic_errors/constraining_field_reference/test.adb @@ -10,7 +10,7 @@ procedure Test is function Foo (X : Boolean) return Rec2 is (Y => 2); V : Integer := Foo (3).Y; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); begin null; end Test; diff --git a/testsuite/tests/semantic_errors/constraining_field_reference/test.out b/testsuite/tests/semantic_errors/constraining_field_reference/test.out index 02c1fd9f9..f87ffe4ee 100644 --- a/testsuite/tests/semantic_errors/constraining_field_reference/test.out +++ b/testsuite/tests/semantic_errors/constraining_field_reference/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node *************************************************************** +Name resolution failed as expected with: + test.adb:12:24: error: expected Boolean, got universal integer 12 | V : Integer := Foo (3).Y; | ^ diff --git a/testsuite/tests/semantic_errors/incompatible_access_type/test.adb b/testsuite/tests/semantic_errors/incompatible_access_type/test.adb index 19683d2e5..3266fa0c8 100644 --- a/testsuite/tests/semantic_errors/incompatible_access_type/test.adb +++ b/testsuite/tests/semantic_errors/incompatible_access_type/test.adb @@ -3,7 +3,7 @@ procedure Test is X : aliased Boolean := True; Y : Integer_Access := X'Access; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); begin null; end Test; diff --git a/testsuite/tests/semantic_errors/incompatible_access_type/test.out b/testsuite/tests/semantic_errors/incompatible_access_type/test.out index d5566b85e..f68255eb9 100644 --- a/testsuite/tests/semantic_errors/incompatible_access_type/test.out +++ b/testsuite/tests/semantic_errors/incompatible_access_type/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ************************************************************* +Name resolution failed as expected with: + test.adb:5:26: error: expected Integer, got Boolean 5 | Y : Integer_Access := X'Access; | ^ diff --git a/testsuite/tests/semantic_errors/incompatible_generic_types/test.adb b/testsuite/tests/semantic_errors/incompatible_generic_types/test.adb index df7bc96f8..0e434a302 100644 --- a/testsuite/tests/semantic_errors/incompatible_generic_types/test.adb +++ b/testsuite/tests/semantic_errors/incompatible_generic_types/test.adb @@ -11,5 +11,5 @@ procedure Test is X_2 : Pkg_2.T; begin X_1 := X_2; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/incompatible_generic_types/test.out b/testsuite/tests/semantic_errors/incompatible_generic_types/test.out index 8c9958dd6..d5c429a81 100644 --- a/testsuite/tests/semantic_errors/incompatible_generic_types/test.out +++ b/testsuite/tests/semantic_errors/incompatible_generic_types/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ********************************************************* +Name resolution failed as expected with: + test.adb:13:11: error: expected T [instance at line 7], got T [instance at line 8] 13 | X_1 := X_2; | ^^^ diff --git a/testsuite/tests/semantic_errors/invalid_argument/test.adb b/testsuite/tests/semantic_errors/invalid_argument/test.adb index 934e2dc5e..b9106e82d 100644 --- a/testsuite/tests/semantic_errors/invalid_argument/test.adb +++ b/testsuite/tests/semantic_errors/invalid_argument/test.adb @@ -2,5 +2,5 @@ procedure Test is procedure Foo (X : Integer) is null; begin Foo (True); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/invalid_argument/test.out b/testsuite/tests/semantic_errors/invalid_argument/test.out index 0226f07d7..f79443f9e 100644 --- a/testsuite/tests/semantic_errors/invalid_argument/test.out +++ b/testsuite/tests/semantic_errors/invalid_argument/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ***************************************************** +Name resolution failed as expected with: + test.adb:4:9: error: expected Integer, got Boolean 4 | Foo (True); | ^^^^ diff --git a/testsuite/tests/semantic_errors/invalid_array_aggregates/test.adb b/testsuite/tests/semantic_errors/invalid_array_aggregates/test.adb index d16d5c25e..dbbfe0ad7 100644 --- a/testsuite/tests/semantic_errors/invalid_array_aggregates/test.adb +++ b/testsuite/tests/semantic_errors/invalid_array_aggregates/test.adb @@ -2,10 +2,10 @@ procedure Test is type Arr is array (Positive range <>) of Integer; A : Arr := (1 .. 10 => True); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); B : Arr := (True .. False => 2); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); begin null; end Test; diff --git a/testsuite/tests/semantic_errors/invalid_array_aggregates/test.out b/testsuite/tests/semantic_errors/invalid_array_aggregates/test.out index c8dabc42b..a23cc3a72 100644 --- a/testsuite/tests/semantic_errors/invalid_array_aggregates/test.out +++ b/testsuite/tests/semantic_errors/invalid_array_aggregates/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ************************************************************* +Name resolution failed as expected with: + test.adb:4:27: error: expected Integer, got Boolean 4 | A : Arr := (1 .. 10 => True); | ^^^^ @@ -12,6 +14,8 @@ test.adb:4:27: error: expected Integer, got Boolean Resolving xrefs for node ************************************************************* +Name resolution failed as expected with: + test.adb:7:16: error: expected Positive, got Boolean 7 | B : Arr := (True .. False => 2); | ^^^^ diff --git a/testsuite/tests/semantic_errors/invalid_array_concat/test.adb b/testsuite/tests/semantic_errors/invalid_array_concat/test.adb index 714497e35..652deb7ad 100644 --- a/testsuite/tests/semantic_errors/invalid_array_concat/test.adb +++ b/testsuite/tests/semantic_errors/invalid_array_concat/test.adb @@ -1,7 +1,7 @@ procedure Test is X : Integer := 2; V : String := "ab" & X; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); begin null; end Test; diff --git a/testsuite/tests/semantic_errors/invalid_array_concat/test.out b/testsuite/tests/semantic_errors/invalid_array_concat/test.out index 750c9db97..334421d9e 100644 --- a/testsuite/tests/semantic_errors/invalid_array_concat/test.out +++ b/testsuite/tests/semantic_errors/invalid_array_concat/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ************************************************************* +Name resolution failed as expected with: + test.adb:3:23: error: no matching operator found 3 | V : String := "ab" & X; | ^ diff --git a/testsuite/tests/semantic_errors/invalid_array_indexing/test.adb b/testsuite/tests/semantic_errors/invalid_array_indexing/test.adb index 891421ee1..3ed59b97a 100644 --- a/testsuite/tests/semantic_errors/invalid_array_indexing/test.adb +++ b/testsuite/tests/semantic_errors/invalid_array_indexing/test.adb @@ -5,11 +5,11 @@ procedure Test is B : Boolean := True; begin A (2) := B; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); B := A (2); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); A (B) := 2; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/invalid_array_indexing/test.out b/testsuite/tests/semantic_errors/invalid_array_indexing/test.out index 69c913a2b..eb8341386 100644 --- a/testsuite/tests/semantic_errors/invalid_array_indexing/test.out +++ b/testsuite/tests/semantic_errors/invalid_array_indexing/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ******************************************************* +Name resolution failed as expected with: + test.adb:7:13: error: expected Integer, got Boolean 7 | A (2) := B; | ^ @@ -12,6 +14,8 @@ test.adb:7:13: error: expected Integer, got Boolean Resolving xrefs for node ********************************************************* +Name resolution failed as expected with: + test.adb:10:9: error: expected Boolean, got Integer 10 | B := A (2); | ^^^^^ @@ -20,6 +24,8 @@ test.adb:10:9: error: expected Boolean, got Integer Resolving xrefs for node ********************************************************* +Name resolution failed as expected with: + test.adb:13:7: error: expected Positive, got Boolean 13 | A (B) := 2; | ^ diff --git a/testsuite/tests/semantic_errors/invalid_assignment/test.adb b/testsuite/tests/semantic_errors/invalid_assignment/test.adb index 52c0c9209..400c1246d 100644 --- a/testsuite/tests/semantic_errors/invalid_assignment/test.adb +++ b/testsuite/tests/semantic_errors/invalid_assignment/test.adb @@ -1,7 +1,7 @@ procedure Test is V : Integer := True; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); begin V := 2.3; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/invalid_assignment/test.out b/testsuite/tests/semantic_errors/invalid_assignment/test.out index 855479dac..2230d2412 100644 --- a/testsuite/tests/semantic_errors/invalid_assignment/test.out +++ b/testsuite/tests/semantic_errors/invalid_assignment/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ************************************************************* +Name resolution failed as expected with: + test.adb:2:19: error: expected Integer, got Boolean 2 | V : Integer := True; | ^^^^ @@ -12,6 +14,8 @@ test.adb:2:19: error: expected Integer, got Boolean Resolving xrefs for node ******************************************************* +Name resolution failed as expected with: + test.adb:5:9: error: expected Integer, got universal real 5 | V := 2.3; | ^^^ diff --git a/testsuite/tests/semantic_errors/invalid_binop_int_and_real/test.adb b/testsuite/tests/semantic_errors/invalid_binop_int_and_real/test.adb index 9cad10db8..a08dca94a 100644 --- a/testsuite/tests/semantic_errors/invalid_binop_int_and_real/test.adb +++ b/testsuite/tests/semantic_errors/invalid_binop_int_and_real/test.adb @@ -1,10 +1,10 @@ procedure Test is X : Integer := 2 + 2.4; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); begin if X < 4.5 then null; end if; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/invalid_binop_int_and_real/test.out b/testsuite/tests/semantic_errors/invalid_binop_int_and_real/test.out index e0521c02f..db4bcec37 100644 --- a/testsuite/tests/semantic_errors/invalid_binop_int_and_real/test.out +++ b/testsuite/tests/semantic_errors/invalid_binop_int_and_real/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ************************************************************* +Name resolution failed as expected with: + test.adb:2:21: error: no matching operator found 2 | X : Integer := 2 + 2.4; | ^ @@ -12,6 +14,8 @@ test.adb:2:21: error: no matching operator found Resolving xrefs for node *************************************************** +Name resolution failed as expected with: + test.adb:5:9: error: no matching operator found 5 | if X < 4.5 then | ^ diff --git a/testsuite/tests/semantic_errors/invalid_record_aggregates/test.adb b/testsuite/tests/semantic_errors/invalid_record_aggregates/test.adb index 9f6fce59f..52d3fb59a 100644 --- a/testsuite/tests/semantic_errors/invalid_record_aggregates/test.adb +++ b/testsuite/tests/semantic_errors/invalid_record_aggregates/test.adb @@ -11,11 +11,11 @@ procedure Test is -- Should not fail silently A : Rec := (K => True, X => 1, Z => 2); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); -- Should not raise an exception B : Rec := (X => 1, Y => 2); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); begin null; end Test; diff --git a/testsuite/tests/semantic_errors/invalid_subprogram_access_call/test.adb b/testsuite/tests/semantic_errors/invalid_subprogram_access_call/test.adb index c083b86fc..b803caeab 100644 --- a/testsuite/tests/semantic_errors/invalid_subprogram_access_call/test.adb +++ b/testsuite/tests/semantic_errors/invalid_subprogram_access_call/test.adb @@ -4,10 +4,10 @@ procedure Test is function Foo (F : Subp; X : Integer) return Boolean is begin X := F (True); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); return F (X); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Foo; begin null; diff --git a/testsuite/tests/semantic_errors/invalid_subprogram_access_call/test.out b/testsuite/tests/semantic_errors/invalid_subprogram_access_call/test.out index b599e5c58..72f8a2ce5 100644 --- a/testsuite/tests/semantic_errors/invalid_subprogram_access_call/test.out +++ b/testsuite/tests/semantic_errors/invalid_subprogram_access_call/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ******************************************************* +Name resolution failed as expected with: + test.adb:6:15: error: expected Integer, got Boolean 6 | X := F (True); | ^^^^ @@ -12,6 +14,8 @@ test.adb:6:15: error: expected Integer, got Boolean Resolving xrefs for node ******************************************************* +Name resolution failed as expected with: + test.adb:9:14: error: expected Boolean, got Integer 9 | return F (X); | ^^^^^ diff --git a/testsuite/tests/semantic_errors/many_no_matching_overload/test.adb b/testsuite/tests/semantic_errors/many_no_matching_overload/test.adb index fa464a407..ccb6e4fd7 100644 --- a/testsuite/tests/semantic_errors/many_no_matching_overload/test.adb +++ b/testsuite/tests/semantic_errors/many_no_matching_overload/test.adb @@ -22,5 +22,5 @@ procedure Test is function Foo (X : T9) return Integer is (0); begin X := Foo (0); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/many_no_matching_overload/test.out b/testsuite/tests/semantic_errors/many_no_matching_overload/test.out index a7783c718..07477e126 100644 --- a/testsuite/tests/semantic_errors/many_no_matching_overload/test.out +++ b/testsuite/tests/semantic_errors/many_no_matching_overload/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ********************************************************* +Name resolution failed as expected with: + test.adb:24:9: error: no matching alternative (showing 3 out of 9 candidates) 24 | X := Foo (0); | ^^^ diff --git a/testsuite/tests/semantic_errors/missing_entity/test.adb b/testsuite/tests/semantic_errors/missing_entity/test.adb index fc13dafad..5b2def62d 100644 --- a/testsuite/tests/semantic_errors/missing_entity/test.adb +++ b/testsuite/tests/semantic_errors/missing_entity/test.adb @@ -1,6 +1,6 @@ procedure Test is X : Integer := Foo (True); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); begin null; end Test; diff --git a/testsuite/tests/semantic_errors/missing_entity/test.out b/testsuite/tests/semantic_errors/missing_entity/test.out index 8189739b9..f416fc1e4 100644 --- a/testsuite/tests/semantic_errors/missing_entity/test.out +++ b/testsuite/tests/semantic_errors/missing_entity/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ************************************************************* +Name resolution failed as expected with: + test.adb:2:19: error: no such entity 2 | X : Integer := Foo (True); | ^^^ diff --git a/testsuite/tests/semantic_errors/multiple_overloads_one_error/test.adb b/testsuite/tests/semantic_errors/multiple_overloads_one_error/test.adb index 445074a3e..bd0439c06 100644 --- a/testsuite/tests/semantic_errors/multiple_overloads_one_error/test.adb +++ b/testsuite/tests/semantic_errors/multiple_overloads_one_error/test.adb @@ -10,8 +10,8 @@ procedure Test is function Bar (X, Y : Integer) return Integer is (X + Y); begin X := Bar (Foo (True), Foo (2)); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); X := Bar (Foo (True), Baz (2)); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/multiple_overloads_one_error/test.out b/testsuite/tests/semantic_errors/multiple_overloads_one_error/test.out index d58d0874e..d69616331 100644 --- a/testsuite/tests/semantic_errors/multiple_overloads_one_error/test.out +++ b/testsuite/tests/semantic_errors/multiple_overloads_one_error/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ********************************************************* +Name resolution failed as expected with: + test.adb:12:26: error: expected Integer, got Boolean 12 | X := Bar (Foo (True), Foo (2)); | ^^^^^^^ @@ -12,6 +14,8 @@ test.adb:12:26: error: expected Integer, got Boolean Resolving xrefs for node ********************************************************* +Name resolution failed as expected with: + test.adb:15:26: error: expected Integer, got Boolean 15 | X := Bar (Foo (True), Baz (2)); | ^^^^^^^ @@ -24,6 +28,8 @@ Analyzing test_2.adb Resolving xrefs for node *********************************************************** +Name resolution failed as expected with: + test_2.adb:12:26: error: expected Integer, got Boolean 12 | X := Bar (Foo (True), Foo (2)); | ^^^^^^^ @@ -36,6 +42,8 @@ Analyzing test_3.adb Resolving xrefs for node **************************************************************** +Name resolution failed as expected with: + test_3.adb:11:7: error: expected Boolean, got Integer 11 | Bar (Foo (2), 2 + 2, True), | ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testsuite/tests/semantic_errors/multiple_overloads_one_error/test_2.adb b/testsuite/tests/semantic_errors/multiple_overloads_one_error/test_2.adb index b4556b7b5..3d3e815f0 100644 --- a/testsuite/tests/semantic_errors/multiple_overloads_one_error/test_2.adb +++ b/testsuite/tests/semantic_errors/multiple_overloads_one_error/test_2.adb @@ -10,5 +10,5 @@ procedure Test_2 is function Bar (X, Y : Integer) return Integer is (X + Y); begin X := Bar (Foo (True), Foo (2)); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test_2; diff --git a/testsuite/tests/semantic_errors/multiple_overloads_one_error/test_3.adb b/testsuite/tests/semantic_errors/multiple_overloads_one_error/test_3.adb index 6a647d1da..3cd571355 100644 --- a/testsuite/tests/semantic_errors/multiple_overloads_one_error/test_3.adb +++ b/testsuite/tests/semantic_errors/multiple_overloads_one_error/test_3.adb @@ -10,7 +10,7 @@ procedure Test_3 is (Foo (True), Bar (Foo (2), 2 + 2, True), "Hello world"); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); begin null; end Test_3; diff --git a/testsuite/tests/semantic_errors/nested_overloaded_calls/test.adb b/testsuite/tests/semantic_errors/nested_overloaded_calls/test.adb index 2cd7fce90..0e9b52e97 100644 --- a/testsuite/tests/semantic_errors/nested_overloaded_calls/test.adb +++ b/testsuite/tests/semantic_errors/nested_overloaded_calls/test.adb @@ -5,5 +5,5 @@ procedure Test is function Foo (X : Boolean) return Integer is (0); begin X := Foo (Foo (True)); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/nested_overloaded_calls/test.out b/testsuite/tests/semantic_errors/nested_overloaded_calls/test.out index 9c2b3ded5..1791c6ddf 100644 --- a/testsuite/tests/semantic_errors/nested_overloaded_calls/test.out +++ b/testsuite/tests/semantic_errors/nested_overloaded_calls/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ******************************************************* +Name resolution failed as expected with: + test.adb:7:14: error: expected Boolean, got Integer 7 | X := Foo (Foo (True)); | ^^^^^^^^^^ @@ -16,6 +18,8 @@ Analyzing test_2.adb Resolving xrefs for node *********************************************************** +Name resolution failed as expected with: + test_2.adb:10:14: error: no matching alternative (showing 3 out of 4 candidates) 10 | X := Bar (Foo (2)); | ^^^ diff --git a/testsuite/tests/semantic_errors/nested_overloaded_calls/test_2.adb b/testsuite/tests/semantic_errors/nested_overloaded_calls/test_2.adb index d5200505c..ae92f6012 100644 --- a/testsuite/tests/semantic_errors/nested_overloaded_calls/test_2.adb +++ b/testsuite/tests/semantic_errors/nested_overloaded_calls/test_2.adb @@ -8,5 +8,5 @@ procedure Test_2 is function Bar (X : Duration) return Integer is (0); begin X := Bar (Foo (2)); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test_2; diff --git a/testsuite/tests/semantic_errors/no_matching_overload/test.adb b/testsuite/tests/semantic_errors/no_matching_overload/test.adb index 93ba85bfb..fa5bb6ac3 100644 --- a/testsuite/tests/semantic_errors/no_matching_overload/test.adb +++ b/testsuite/tests/semantic_errors/no_matching_overload/test.adb @@ -5,5 +5,5 @@ procedure Test is function Foo (X : Float) return Integer is (0); begin X := Foo (True); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/no_matching_overload/test.out b/testsuite/tests/semantic_errors/no_matching_overload/test.out index bed258d1b..f8b914d67 100644 --- a/testsuite/tests/semantic_errors/no_matching_overload/test.out +++ b/testsuite/tests/semantic_errors/no_matching_overload/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ******************************************************* +Name resolution failed as expected with: + test.adb:7:9: error: no matching alternative (of 2 candidates) 7 | X := Foo (True); | ^^^ diff --git a/testsuite/tests/semantic_errors/no_matching_overload_dotted_call/test.adb b/testsuite/tests/semantic_errors/no_matching_overload_dotted_call/test.adb index 5b7292885..74df9c6e2 100644 --- a/testsuite/tests/semantic_errors/no_matching_overload_dotted_call/test.adb +++ b/testsuite/tests/semantic_errors/no_matching_overload_dotted_call/test.adb @@ -14,8 +14,8 @@ procedure Test is R : Pkg.T := (null record); begin X := R.Foo (True); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); X := R.Bar; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/no_matching_overload_dotted_call/test.out b/testsuite/tests/semantic_errors/no_matching_overload_dotted_call/test.out index 8ce0f919d..a3f5e8f43 100644 --- a/testsuite/tests/semantic_errors/no_matching_overload_dotted_call/test.out +++ b/testsuite/tests/semantic_errors/no_matching_overload_dotted_call/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ********************************************************* +Name resolution failed as expected with: + test.adb:16:9: error: no matching alternative (of 2 candidates) 16 | X := R.Foo (True); | ^^^^^ @@ -20,6 +22,8 @@ test.adb:8:35: info: expected Float, got Boolean Resolving xrefs for node ********************************************************* +Name resolution failed as expected with: + test.adb:19:9: error: expected Integer, got Float 19 | X := R.Bar; | ^^^^^ diff --git a/testsuite/tests/semantic_errors/no_matching_overload_nested_call/test.adb b/testsuite/tests/semantic_errors/no_matching_overload_nested_call/test.adb index ab5f62a0a..a150d7b86 100644 --- a/testsuite/tests/semantic_errors/no_matching_overload_nested_call/test.adb +++ b/testsuite/tests/semantic_errors/no_matching_overload_nested_call/test.adb @@ -5,5 +5,5 @@ procedure Test is procedure Bar (X : Integer) is null; begin Bar (Foo (2.5)); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/no_matching_overload_nested_call/test.out b/testsuite/tests/semantic_errors/no_matching_overload_nested_call/test.out index 2b9def68b..b96fa7892 100644 --- a/testsuite/tests/semantic_errors/no_matching_overload_nested_call/test.out +++ b/testsuite/tests/semantic_errors/no_matching_overload_nested_call/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ***************************************************** +Name resolution failed as expected with: + test.adb:7:9: error: no matching alternative (of 2 candidates) 7 | Bar (Foo (2.5)); | ^^^ diff --git a/testsuite/tests/semantic_errors/non_tagged_record_extension/test.adb b/testsuite/tests/semantic_errors/non_tagged_record_extension/test.adb index 17fcc2bc8..f3aae26d6 100644 --- a/testsuite/tests/semantic_errors/non_tagged_record_extension/test.adb +++ b/testsuite/tests/semantic_errors/non_tagged_record_extension/test.adb @@ -6,5 +6,5 @@ procedure Test is X, Y : T; begin X := (Y with V => 1); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/non_tagged_record_extension/test.out b/testsuite/tests/semantic_errors/non_tagged_record_extension/test.out index bb1589729..fb1bf599d 100644 --- a/testsuite/tests/semantic_errors/non_tagged_record_extension/test.out +++ b/testsuite/tests/semantic_errors/non_tagged_record_extension/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ******************************************************* +Name resolution failed as expected with: + test.adb:8:10: error: expected tagged type, got T 8 | X := (Y with V => 1); | ^ diff --git a/testsuite/tests/semantic_errors/not_boolean_condition/test.adb b/testsuite/tests/semantic_errors/not_boolean_condition/test.adb index fe5a25fcb..080edc385 100644 --- a/testsuite/tests/semantic_errors/not_boolean_condition/test.adb +++ b/testsuite/tests/semantic_errors/not_boolean_condition/test.adb @@ -4,10 +4,10 @@ begin if V then null; end if; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); while True loop exit when V; - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end loop; end Test; diff --git a/testsuite/tests/semantic_errors/not_boolean_condition/test.out b/testsuite/tests/semantic_errors/not_boolean_condition/test.out index 8412287d3..4bd2b3620 100644 --- a/testsuite/tests/semantic_errors/not_boolean_condition/test.out +++ b/testsuite/tests/semantic_errors/not_boolean_condition/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node *************************************************** +Name resolution failed as expected with: + test.adb:4:7: error: expected boolean type, got Integer 4 | if V then | ^ @@ -12,6 +14,8 @@ test.adb:4:7: error: expected boolean type, got Integer Resolving xrefs for node ******************************************************* +Name resolution failed as expected with: + test.adb:10:17: error: expected boolean type, got Integer 10 | exit when V; | ^ diff --git a/testsuite/tests/semantic_errors/one_statement_two_errors/test.adb b/testsuite/tests/semantic_errors/one_statement_two_errors/test.adb index e096a0e4d..40a893e94 100644 --- a/testsuite/tests/semantic_errors/one_statement_two_errors/test.adb +++ b/testsuite/tests/semantic_errors/one_statement_two_errors/test.adb @@ -2,5 +2,5 @@ procedure Test is procedure Foo (X : Integer; Y : Boolean) is null; begin Foo (True, 2 + 2); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/one_statement_two_errors/test.out b/testsuite/tests/semantic_errors/one_statement_two_errors/test.out index dcc1d8c14..5a5aa983b 100644 --- a/testsuite/tests/semantic_errors/one_statement_two_errors/test.out +++ b/testsuite/tests/semantic_errors/one_statement_two_errors/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ***************************************************** +Name resolution failed as expected with: + test.adb:4:17: error: no matching operator found 4 | Foo (True, 2 + 2); | ^ diff --git a/testsuite/tests/semantic_errors/overloading_different_units/test.adb b/testsuite/tests/semantic_errors/overloading_different_units/test.adb index b5dab1ce9..a2a0cc7f7 100644 --- a/testsuite/tests/semantic_errors/overloading_different_units/test.adb +++ b/testsuite/tests/semantic_errors/overloading_different_units/test.adb @@ -2,7 +2,7 @@ with Pkg; use Pkg; procedure Test is X : Integer := Foo (2); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); begin null; end Test; diff --git a/testsuite/tests/semantic_errors/overloading_different_units/test.out b/testsuite/tests/semantic_errors/overloading_different_units/test.out index 7e16c9098..8613ad88b 100644 --- a/testsuite/tests/semantic_errors/overloading_different_units/test.out +++ b/testsuite/tests/semantic_errors/overloading_different_units/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ************************************************************* +Name resolution failed as expected with: + test.adb:4:19: error: no matching alternative (of 2 candidates) 4 | X : Integer := Foo (2); | ^^^ diff --git a/testsuite/tests/semantic_errors/partially_matching_overloads/test.adb b/testsuite/tests/semantic_errors/partially_matching_overloads/test.adb index 8571026d0..fd7ff7033 100644 --- a/testsuite/tests/semantic_errors/partially_matching_overloads/test.adb +++ b/testsuite/tests/semantic_errors/partially_matching_overloads/test.adb @@ -5,5 +5,5 @@ procedure Test is function Foo (X : Boolean) return Integer is (0); begin X := Foo (2); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test; diff --git a/testsuite/tests/semantic_errors/partially_matching_overloads/test.out b/testsuite/tests/semantic_errors/partially_matching_overloads/test.out index 686f96c6f..e4e6bea2a 100644 --- a/testsuite/tests/semantic_errors/partially_matching_overloads/test.out +++ b/testsuite/tests/semantic_errors/partially_matching_overloads/test.out @@ -4,6 +4,8 @@ Analyzing test.adb Resolving xrefs for node ******************************************************* +Name resolution failed as expected with: + test.adb:7:9: error: no matching alternative (of 2 candidates) 7 | X := Foo (2); | ^^^ diff --git a/testsuite/tests/semantic_errors/variable_shadowing/test.adb b/testsuite/tests/semantic_errors/variable_shadowing/test.adb index dbd8f32ba..602ace5a4 100644 --- a/testsuite/tests/semantic_errors/variable_shadowing/test.adb +++ b/testsuite/tests/semantic_errors/variable_shadowing/test.adb @@ -3,7 +3,7 @@ begin declare S : constant String := "Other_S"; T : constant String := Integer'Image (S); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); begin null; end; diff --git a/testsuite/tests/semantic_errors/wrong_arity/test.adb b/testsuite/tests/semantic_errors/wrong_arity/test.adb index 5344aec42..1471cc031 100644 --- a/testsuite/tests/semantic_errors/wrong_arity/test.adb +++ b/testsuite/tests/semantic_errors/wrong_arity/test.adb @@ -4,5 +4,5 @@ procedure Test is function Foo (X : Integer; Y : Boolean) return Integer is (0); begin X := Foo (2); - pragma Test_Statement; + pragma Test_Statement (Expect_Fail => True); end Test;