diff options
| author | Jacob G-W <jacoblevgw@gmail.com> | 2022-01-27 15:23:28 -0500 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-02-13 14:42:20 +0200 |
| commit | 3bbe6a28e069b03c8a9185dd14129517453e26d2 (patch) | |
| tree | b868356b27a7be324cbc1625df8b6bd13c3cc9d9 /src/Module.zig | |
| parent | 0b7347fd18eee7dd829cd9aaed3683123d84859b (diff) | |
| download | zig-3bbe6a28e069b03c8a9185dd14129517453e26d2.tar.gz zig-3bbe6a28e069b03c8a9185dd14129517453e26d2.zip | |
stage2: add decltests
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig index 3631e41f25..b9e50355fd 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -4170,6 +4170,7 @@ fn scanDecl(iter: *ScanDeclIter, decl_sub_index: usize, flags: u4) SemaError!voi const line_off = zir.extra[decl_sub_index + 4]; const line = iter.parent_decl.relativeToLine(line_off); const decl_name_index = zir.extra[decl_sub_index + 5]; + const decl_doccomment_index = zir.extra[decl_sub_index + 7]; const decl_index = zir.extra[decl_sub_index + 6]; const decl_block_inst_data = zir.instructions.items(.data)[decl_index].pl_node; const decl_node = iter.parent_decl.relativeToNodeIndex(decl_block_inst_data.src_node); @@ -4193,6 +4194,11 @@ fn scanDecl(iter: *ScanDeclIter, decl_sub_index: usize, flags: u4) SemaError!voi iter.unnamed_test_index += 1; break :name try std.fmt.allocPrintZ(gpa, "test_{d}", .{i}); }, + 2 => name: { + is_named_test = true; + const test_name = zir.nullTerminatedString(decl_doccomment_index); + break :name try std.fmt.allocPrintZ(gpa, "decltest.{s}", .{test_name}); + }, else => name: { const raw_name = zir.nullTerminatedString(decl_name_index); if (raw_name.len == 0) { |
