Skip to content

Commit 3b24fed

Browse files
aykevldeadprogram
authored andcommitted
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.
1 parent 8cd2a46 commit 3b24fed

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

compiler/compiler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestCompiler(t *testing.T) {
3232
t.Skip("compiler tests require LLVM 11 or above, got LLVM ", llvm.Version)
3333
}
3434

35-
target, err := compileopts.LoadTarget("i686--linux")
35+
target, err := compileopts.LoadTarget("wasm")
3636
if err != nil {
3737
t.Fatal("failed to load target:", err)
3838
}

compiler/testdata/basic.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; ModuleID = 'basic.go'
22
source_filename = "basic.go"
3-
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"
4-
target triple = "i686--linux"
3+
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4+
target triple = "wasm32--wasi"
55

66
declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*)
77

compiler/testdata/float.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; ModuleID = 'float.go'
22
source_filename = "float.go"
3-
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"
4-
target triple = "i686--linux"
3+
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4+
target triple = "wasm32--wasi"
55

66
declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*)
77

compiler/testdata/func.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; ModuleID = 'func.go'
22
source_filename = "func.go"
3-
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"
4-
target triple = "i686--linux"
3+
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4+
target triple = "wasm32--wasi"
55

66
%runtime.funcValueWithSignature = type { i32, i8* }
77

compiler/testdata/interface.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; ModuleID = 'interface.go'
22
source_filename = "interface.go"
3-
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"
4-
target triple = "i686--linux"
3+
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4+
target triple = "wasm32--wasi"
55

66
%runtime.typecodeID = type { %runtime.typecodeID*, i32, %runtime.interfaceMethodInfo*, %runtime.typecodeID* }
77
%runtime.interfaceMethodInfo = type { i8*, i32 }

compiler/testdata/pointer.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; ModuleID = 'pointer.go'
22
source_filename = "pointer.go"
3-
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"
4-
target triple = "i686--linux"
3+
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4+
target triple = "wasm32--wasi"
55

66
declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*)
77

compiler/testdata/slice.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; ModuleID = 'slice.go'
22
source_filename = "slice.go"
3-
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"
4-
target triple = "i686--linux"
3+
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4+
target triple = "wasm32--wasi"
55

66
declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*)
77

compiler/testdata/string.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; ModuleID = 'string.go'
22
source_filename = "string.go"
3-
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"
4-
target triple = "i686--linux"
3+
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
4+
target triple = "wasm32--wasi"
55

66
%runtime._string = type { i8*, i32 }
77

0 commit comments

Comments
 (0)