Skip to content

Commit debc778

Browse files
committed
compiler/testdata: improve tests for structs.HostLayout
1 parent 8fb3457 commit debc778

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

compiler/testdata/errors.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type S struct {
2525
}
2626

2727
//go:wasmimport modulename validparam
28-
func validparam(a int32, b uint64, c float64, d unsafe.Pointer, e Uint, f uintptr, g string, h *int32, i *S, j *[8]uint8)
28+
func validparam(a int32, b uint64, c float64, d unsafe.Pointer, e Uint, f uintptr, g string, h *int32, i *S, j *struct{}, k *[8]uint8)
2929

3030
// ERROR: //go:wasmimport modulename invalidparam: unsupported parameter type [4]uint32
3131
// ERROR: //go:wasmimport modulename invalidparam: unsupported parameter type []byte
@@ -39,6 +39,12 @@ func validparam(a int32, b uint64, c float64, d unsafe.Pointer, e Uint, f uintpt
3939
//go:wasmimport modulename invalidparam
4040
func invalidparam(a [4]uint32, b []byte, c struct{ a int }, d chan struct{}, e func(), f int, g uint, h [8]int)
4141

42+
// ERROR: //go:wasmimport modulename invalidparam_no_hostlayout: unsupported parameter type *struct{int}
43+
// ERROR: //go:wasmimport modulename invalidparam_no_hostlayout: unsupported parameter type *struct{string}
44+
//
45+
//go:wasmimport modulename invalidparam_no_hostlayout
46+
func invalidparam_no_hostlayout(a *struct{ int }, b *struct{ string })
47+
4248
//go:wasmimport modulename validreturn_int32
4349
func validreturn_int32() int32
4450

@@ -51,6 +57,9 @@ func validreturn_ptr_string() *string
5157
//go:wasmimport modulename validreturn_ptr_struct
5258
func validreturn_ptr_struct() *S
5359

60+
//go:wasmimport modulename validreturn_ptr_struct
61+
func validreturn_ptr_empty_struct() *struct{}
62+
5463
//go:wasmimport modulename validreturn_ptr_array
5564
func validreturn_ptr_array() *[8]uint8
5665

0 commit comments

Comments
 (0)