Skip to content

Commit 04cd103

Browse files
committed
Merge branch 'mr/pmderodat/master' into 'master'
Port edge patches to master See merge request eng/das/cov/gnatcoverage!980 For https://gitlab.adacore-it.com/eng/shared/anod/-/issues/717 Depends-On: https://gitlab.adacore-it.com/eng/shared/anod/-/merge_requests/6950
2 parents 05a572e + bf68c23 commit 04cd103

File tree

16 files changed

+122
-38
lines changed

16 files changed

+122
-38
lines changed

doc/gnatcov/external_annotations.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,14 @@ This depends mainly on the language of the file to be annotated:
378378
of that construct the annotation will be remapped properly. If the enclosing
379379
construct is modified, the annotation will be invalidated.
380380

381-
- For C sources, the annotations are currently not stable through modifications.
382-
Any modification to the annotated source file will invalidate the annotations.
381+
- For Cor C++ sources, the annotations are tied to the inner-most enclosing
382+
named declaration, such as a function declaration for C, or any of a
383+
namespace declaration, a class declaration or function/method declaration for
384+
C++.
385+
386+
Note that in both cases, if no enclosing named construct can be found, the
387+
|gcvaddan| command will emit a warning and fall back to an absolute annotation,
388+
which is invalidated as soon as the file is modified.
383389

384390
If an annotation is invalidated gnatcov will emit a warning stating that the
385391
annotation was ignored, along with its unique identifier.

testsuite/tests/Ada2022/aggregates/containers/src/pkg.adb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ package body Pkg is
1414
declare
1515
Elt : constant Integer := Input.First_Element; -- # single_elt_st
1616
begin
17-
return [(if Elt > 0 then Elt else Elt) => -- # single_elt_dc
18-
(if Elt > 0 then Elt else Elt)]; -- # single_elt_dc
17+
return [(if Elt > 0 then Elt else Elt) => -- # single_elt_dc1
18+
(if Elt > 0 then Elt else Elt)]; -- # single_elt_dc2
1919
end;
2020
else
2121
return [for Elt of Input use -- # multi_elt_st
22-
(if Elt > 0 then Elt else Elt) => -- # multi_elt_dc
23-
(if Elt > 0 then Elt else Elt)]; -- # multi_elt_dc
22+
(if Elt > 0 then Elt else Elt) => -- # multi_elt_dc1
23+
(if Elt > 0 then Elt else Elt)]; -- # multi_elt_dc2
2424
end if;
2525
end Overly_Complex_Identity_Build;
2626

testsuite/tests/Ada2022/aggregates/containers/src/pkg.ads

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ with Ada.Containers.Ordered_Sets;
44
package Pkg is
55

66
package Int_Maps is new Ada.Containers.Ordered_Maps
7-
(Key_Type => Positive, Element_Type => Integer);
7+
(Key_Type => Integer, Element_Type => Integer);
88
subtype Int_Map is Int_Maps.Map;
99

1010
package Int_Sets is new Ada.Containers.Ordered_Sets

testsuite/tests/Ada2022/aggregates/containers/src/test_0.adb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ end Test_0;
1212
-- /empty_aggr_st/ l- ## s-
1313
-- /single_elt_guard/ l- ## s-
1414
-- /single_elt_st/ l- ## s-
15-
-- /single_elt_dc/ l- ## 0
15+
-- /single_elt_dc1/ l- ## s-
16+
-- /single_elt_dc2/ l- ## 0
1617
-- /multi_elt_st/ l- ## s-
17-
-- /multi_elt_dc/ l- ## 0
18+
-- /multi_elt_dc1/ l- ## 0
19+
-- /multi_elt_dc2/ l- ## 0

testsuite/tests/Ada2022/aggregates/containers/src/test_empty.adb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ end Test_Empty;
1515
-- /empty_aggr_st/ l+ ## 0
1616
-- /single_elt_guard/ l- ## s-
1717
-- /single_elt_st/ l- ## s-
18-
-- /single_elt_dc/ l- ## 0
18+
-- /single_elt_dc1/ l- ## s-
19+
-- /single_elt_dc2/ l- ## 0
1920
-- /multi_elt_st/ l- ## s-
20-
-- /multi_elt_dc/ l- ## 0
21+
-- /multi_elt_dc1/ l- ## 0
22+
-- /multi_elt_dc2/ l- ## 0

testsuite/tests/Ada2022/aggregates/containers/src/test_full.adb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ end Test_Full;
1818
-- /empty_aggr_st/ l+ ## 0
1919
-- /single_elt_guard/ l+ ## 0
2020
-- /single_elt_st/ l+ ## 0
21-
-- /single_elt_dc/ l+ ## 0
21+
-- /single_elt_dc1/ l+ ## 0
22+
-- /single_elt_dc2/ l+ ## 0
2223
-- /multi_elt_st/ l+ ## 0
23-
-- /multi_elt_dc/ l+ ## 0
24+
-- /multi_elt_dc1/ l+ ## 0
25+
-- /multi_elt_dc2/ l+ ## 0

testsuite/tests/Ada2022/aggregates/containers/src/test_multi.adb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ end Test_Multi;
1515
-- /empty_aggr_st/ l- ## s-
1616
-- /single_elt_guard/ l! ## dT-
1717
-- /single_elt_st/ l- ## s-
18-
-- /single_elt_dc/ l- ## 0
18+
-- /single_elt_dc1/ l- ## s-
19+
-- /single_elt_dc2/ l- ## 0
1920
-- /multi_elt_st/ l+ ## 0
20-
-- /multi_elt_dc/ l+ ## 0
21+
-- /multi_elt_dc1/ l+ ## 0
22+
-- /multi_elt_dc2/ l+ ## 0

testsuite/tests/Ada2022/aggregates/containers/src/test_single.adb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ end Test_Single;
1515
-- /empty_aggr_st/ l- ## s-
1616
-- /single_elt_guard/ l! ## dF-
1717
-- /single_elt_st/ l+ ## 0
18-
-- /single_elt_dc/ l! ## dF-
18+
-- /single_elt_dc1/ l! ## dF-
19+
-- /single_elt_dc2/ l! ## dF-
1920
-- /multi_elt_st/ l- ## s-
20-
-- /multi_elt_dc/ l- ## 0
21+
-- /multi_elt_dc1/ l- ## 0
22+
-- /multi_elt_dc2/ l- ## 0
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
RTS_ZFP DEAD Test instantiates containers
2-
!RTS_ZFP XFAIL Compiler crash (eng/toolchain/gnat#1543)
1+
!native DEAD Test instantiates containers

testsuite/tests/ext_annotations/gen/c_ex/Nominal/test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@
2828
),
2929
]
3030

31-
annot_file = generate_annotations(annotations)
31+
annot_file = generate_annotations(
32+
annotations,
33+
tolerate_messages=(
34+
"warning: Could not create an auto-relocating annotation for src/"
35+
"pkg.c:6:4 - 12:22, creating an absolute location annotation instead."
36+
),
37+
)
38+
3239

3340
# Check we get the expected results
3441
TestCase(category=CAT.mcdc).run(

0 commit comments

Comments
 (0)