aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/compiler_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/compiler/compiler_test.go')
-rw-r--r--pkg/compiler/compiler_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/compiler/compiler_test.go b/pkg/compiler/compiler_test.go
index f43b2ccb3..711567163 100644
--- a/pkg/compiler/compiler_test.go
+++ b/pkg/compiler/compiler_test.go
@@ -137,6 +137,27 @@ func TestData(t *testing.T) {
}
}
+func TestAutoConsts(t *testing.T) {
+ t.Parallel()
+ eh := func(pos ast.Pos, msg string) {
+ t.Errorf("%v: %v", pos, msg)
+ }
+ desc := ast.ParseGlob(filepath.Join("testdata", "auto*.txt"), eh)
+ if desc == nil {
+ t.Fatalf("parsing failed")
+ }
+ constFile := DeserializeConstFile(filepath.Join("testdata", "auto*.txt.const"), eh)
+ if constFile == nil {
+ t.Fatalf("const loading failed")
+ }
+ target := targets.List[targets.TestOS][targets.TestArch64]
+ consts := constFile.Arch(targets.TestArch64)
+ prog := Compile(desc, consts, target, eh)
+ if prog == nil {
+ t.Fatalf("compilation failed")
+ }
+}
+
func TestFuzz(t *testing.T) {
t.Parallel()
for _, data := range []string{