aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/compiler_test.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-09-19 16:46:40 +0200
committerAleksandr Nogikh <nogikh@google.com>2023-10-04 09:27:33 +0000
commit8144982a26c6b8e5f0f5401c2a2de99e4ced04cd (patch)
treee17e1e9cfd27739da3f002744506d22e73ff2c0d /pkg/compiler/compiler_test.go
parentc4dc646bee41c7e983a13750652f1035ae27b737 (diff)
sys: refactor const extraction
1) Make FabricateSyscallConsts() operate on ConstFile. 2) Expose Pos inside ConstInfo.
Diffstat (limited to 'pkg/compiler/compiler_test.go')
-rw-r--r--pkg/compiler/compiler_test.go8
1 files changed, 6 insertions, 2 deletions
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" {