From 8144982a26c6b8e5f0f5401c2a2de99e4ced04cd Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 19 Sep 2023 16:46:40 +0200 Subject: sys: refactor const extraction 1) Make FabricateSyscallConsts() operate on ConstFile. 2) Expose Pos inside ConstInfo. --- pkg/compiler/compiler_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pkg/compiler/compiler_test.go') diff --git a/pkg/compiler/compiler_test.go b/pkg/compiler/compiler_test.go index be40e817b..84ddb9f8e 100644 --- a/pkg/compiler/compiler_test.go +++ b/pkg/compiler/compiler_test.go @@ -87,15 +87,19 @@ func TestData(t *testing.T) { em.DumpErrors() t.Fatalf("const extraction failed") } - consts := map[string]uint64{ + cf := NewConstFile() + if err := cf.AddArch(arch, map[string]uint64{ "SYS_foo": 1, "C0": 0, "C1": 1, "C2": 2, "U8_MAX": 0xff, "U16_MAX": 0xffff, + }, nil); err != nil { + t.Fatal(err) } - FabricateSyscallConsts(target, constInfo, consts) + FabricateSyscallConsts(target, constInfo, cf) + consts := cf.Arch(arch) delete(consts, "SYS_unsupported") desc := Compile(astDesc, consts, target, em.ErrorHandler) if name == "errors2.txt" || name == "errors3.txt" { -- cgit mrf-deployment