Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gotypes: test case for issue #195 #214

Merged
merged 2 commits into from
Oct 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gotypes/signature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 15 additions & 0 deletions tests/fixedbugs/issue195/asm.go
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 0 deletions tests/fixedbugs/issue195/doc.go
Original file line number Diff line number Diff line change
@@ -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 changes: 7 additions & 0 deletions tests/fixedbugs/issue195/issue195.s
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 0 deletions tests/fixedbugs/issue195/issue195_test.go
Original file line number Diff line number Diff line change
@@ -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 changes: 6 additions & 0 deletions tests/fixedbugs/issue195/stub.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.