Adds test cases for the bug in #195, similar to #212. Updates #195 Updates #191
This commit is contained in:
committed by
GitHub
parent
7de02518a2
commit
4f7179b08e
@@ -159,7 +159,8 @@ func TestSignatureSizes(t *testing.T) {
|
||||
{"func(uint64) uint64", 16},
|
||||
{"func([7]byte) byte", 9},
|
||||
{"func(uint64, uint64) (uint64, uint64)", 32},
|
||||
{"func(uint16)", 2},
|
||||
{"func(uint16)", 2}, // issue #191
|
||||
{"func(*uint64, uint32)", 12}, // issue #195
|
||||
}
|
||||
for _, c := range cases {
|
||||
s, err := ParseSignature(c.Expr)
|
||||
|
||||
15
tests/fixedbugs/issue195/asm.go
Normal file
15
tests/fixedbugs/issue195/asm.go
Normal file
@@ -0,0 +1,15 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
. "github.com/mmcloughlin/avo/build"
|
||||
)
|
||||
|
||||
func main() {
|
||||
TEXT("Issue195", NOSPLIT|NOFRAME, "func(x *uint64, y uint32)")
|
||||
Doc("Issue195 tests for correct argument size.")
|
||||
RET()
|
||||
Generate()
|
||||
}
|
||||
3
tests/fixedbugs/issue195/doc.go
Normal file
3
tests/fixedbugs/issue195/doc.go
Normal file
@@ -0,0 +1,3 @@
|
||||
// Package issue195 tests for correct argument size for a function without
|
||||
// return types. This test is closely related to issue #191.
|
||||
package issue195
|
||||
7
tests/fixedbugs/issue195/issue195.s
Normal file
7
tests/fixedbugs/issue195/issue195.s
Normal file
@@ -0,0 +1,7 @@
|
||||
// Code generated by command: go run asm.go -out issue195.s -stubs stub.go. DO NOT EDIT.
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
// func Issue195(x *uint64, y uint32)
|
||||
TEXT ·Issue195(SB), NOSPLIT|NOFRAME, $0-12
|
||||
RET
|
||||
10
tests/fixedbugs/issue195/issue195_test.go
Normal file
10
tests/fixedbugs/issue195/issue195_test.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package issue195
|
||||
|
||||
import "testing"
|
||||
|
||||
//go:generate go run asm.go -out issue195.s -stubs stub.go
|
||||
|
||||
func TestIssue195(t *testing.T) {
|
||||
x := uint64(42)
|
||||
Issue195(&x, 42)
|
||||
}
|
||||
6
tests/fixedbugs/issue195/stub.go
Normal file
6
tests/fixedbugs/issue195/stub.go
Normal file
@@ -0,0 +1,6 @@
|
||||
// Code generated by command: go run asm.go -out issue195.s -stubs stub.go. DO NOT EDIT.
|
||||
|
||||
package issue195
|
||||
|
||||
// Issue195 tests for correct argument size.
|
||||
func Issue195(x *uint64, y uint32)
|
||||
Reference in New Issue
Block a user