From 3b24fedf922549297ae42c2da7e9292741334d76 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Wed, 5 May 2021 15:07:39 +0200 Subject: [PATCH] compiler: use wasm for tests The next commit will change the implementation of func values on Linux as a result of switching to a task-based scheduler. To keep the compiler/testdata/func.go test working as expected, switch to WebAssembly tests. --- compiler/compiler_test.go | 2 +- compiler/testdata/basic.ll | 4 ++-- compiler/testdata/float.ll | 4 ++-- compiler/testdata/func.ll | 4 ++-- compiler/testdata/interface.ll | 4 ++-- compiler/testdata/pointer.ll | 4 ++-- compiler/testdata/slice.ll | 4 ++-- compiler/testdata/string.ll | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/compiler/compiler_test.go b/compiler/compiler_test.go index 444d5f28..394ef1c2 100644 --- a/compiler/compiler_test.go +++ b/compiler/compiler_test.go @@ -32,7 +32,7 @@ func TestCompiler(t *testing.T) { t.Skip("compiler tests require LLVM 11 or above, got LLVM ", llvm.Version) } - target, err := compileopts.LoadTarget("i686--linux") + target, err := compileopts.LoadTarget("wasm") if err != nil { t.Fatal("failed to load target:", err) } diff --git a/compiler/testdata/basic.ll b/compiler/testdata/basic.ll index 0c4f06c3..cdafea0f 100644 --- a/compiler/testdata/basic.ll +++ b/compiler/testdata/basic.ll @@ -1,7 +1,7 @@ ; ModuleID = 'basic.go' source_filename = "basic.go" -target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128" -target triple = "i686--linux" +target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" +target triple = "wasm32--wasi" declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*) diff --git a/compiler/testdata/float.ll b/compiler/testdata/float.ll index 009b92c0..6d35d33e 100644 --- a/compiler/testdata/float.ll +++ b/compiler/testdata/float.ll @@ -1,7 +1,7 @@ ; ModuleID = 'float.go' source_filename = "float.go" -target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128" -target triple = "i686--linux" +target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" +target triple = "wasm32--wasi" declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*) diff --git a/compiler/testdata/func.ll b/compiler/testdata/func.ll index 9438a92e..4ccea0aa 100644 --- a/compiler/testdata/func.ll +++ b/compiler/testdata/func.ll @@ -1,7 +1,7 @@ ; ModuleID = 'func.go' source_filename = "func.go" -target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128" -target triple = "i686--linux" +target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" +target triple = "wasm32--wasi" %runtime.funcValueWithSignature = type { i32, i8* } diff --git a/compiler/testdata/interface.ll b/compiler/testdata/interface.ll index 1414db8c..eb217bdc 100644 --- a/compiler/testdata/interface.ll +++ b/compiler/testdata/interface.ll @@ -1,7 +1,7 @@ ; ModuleID = 'interface.go' source_filename = "interface.go" -target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128" -target triple = "i686--linux" +target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" +target triple = "wasm32--wasi" %runtime.typecodeID = type { %runtime.typecodeID*, i32, %runtime.interfaceMethodInfo*, %runtime.typecodeID* } %runtime.interfaceMethodInfo = type { i8*, i32 } diff --git a/compiler/testdata/pointer.ll b/compiler/testdata/pointer.ll index 26a584a9..94896ab8 100644 --- a/compiler/testdata/pointer.ll +++ b/compiler/testdata/pointer.ll @@ -1,7 +1,7 @@ ; ModuleID = 'pointer.go' source_filename = "pointer.go" -target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128" -target triple = "i686--linux" +target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" +target triple = "wasm32--wasi" declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*) diff --git a/compiler/testdata/slice.ll b/compiler/testdata/slice.ll index 0cc5f8a6..6a62c8bc 100644 --- a/compiler/testdata/slice.ll +++ b/compiler/testdata/slice.ll @@ -1,7 +1,7 @@ ; ModuleID = 'slice.go' source_filename = "slice.go" -target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128" -target triple = "i686--linux" +target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" +target triple = "wasm32--wasi" declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*) diff --git a/compiler/testdata/string.ll b/compiler/testdata/string.ll index 1c66e9a6..66cf4781 100644 --- a/compiler/testdata/string.ll +++ b/compiler/testdata/string.ll @@ -1,7 +1,7 @@ ; ModuleID = 'string.go' source_filename = "string.go" -target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128" -target triple = "i686--linux" +target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" +target triple = "wasm32--wasi" %runtime._string = type { i8*, i32 }