File tree Expand file tree Collapse file tree 3 files changed +23
-5
lines changed
testsuite/tests/checks/bit_records Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 11# TODO: move this function to libadalang
22fun lal_is_mod_type(n) =
3- n.f_type_expr.p_designated_type_decl().f_type_def is ModIntTypeDef
3+ n.f_type_expr.p_designated_type_decl().p_root_type() is TypeDecl(f_type_def: ModIntTypeDef)
44
55@check(message="bit record without layout definition",
66 category="Style", subcategory="Portability")
Original file line number Diff line number Diff line change 11package Bit is
22 type My_Mod is mod 8 ;
3+ subtype X is My_Mod;
4+ type D is new My_Mod;
35
46 type Rec1 is record -- NOFLAG
57 I : My_Mod;
@@ -17,4 +19,12 @@ package Bit is
1719 type Rec2_PA is record -- FLAG
1820 I : My_Mod;
1921 end record with Pack, Size => 32 ;
22+
23+ type Rec3 is record -- FLAG
24+ I : X;
25+ end record with Pack;
26+
27+ type Rec4 is record -- FLAG
28+ I : D;
29+ end record with Pack;
2030end Bit ;
Original file line number Diff line number Diff line change 1- bit.ads:11 :9: rule violation: bit record without layout definition
2- 11 | type Rec2_PP is record -- FLAG
1+ bit.ads:13 :9: rule violation: bit record without layout definition
2+ 13 | type Rec2_PP is record -- FLAG
33 | ^^^^^^^
44
5- bit.ads:17 :9: rule violation: bit record without layout definition
6- 17 | type Rec2_PA is record -- FLAG
5+ bit.ads:19 :9: rule violation: bit record without layout definition
6+ 19 | type Rec2_PA is record -- FLAG
77 | ^^^^^^^
88
9+ bit.ads:23:9: rule violation: bit record without layout definition
10+ 23 | type Rec3 is record -- FLAG
11+ | ^^^^
12+
13+ bit.ads:27:9: rule violation: bit record without layout definition
14+ 27 | type Rec4 is record -- FLAG
15+ | ^^^^
16+
You can’t perform that action at this time.
0 commit comments