Skip to content

Commit

Permalink
tests/attrtest: move decl to non-test file
Browse files Browse the repository at this point in the history
Solves the asmdecl error:

  [amd64] AttrTest: function AttrTest missing Go declaration

Updates mmcloughlin#24
  • Loading branch information
mmcloughlin committed Jan 13, 2019
1 parent a23fe8e commit 16c602d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 6 additions & 0 deletions tests/textflag/attrtest.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Package textflag tests that avo attribute constants agree with textflag.h.
package textflag

//go:generate go run make_attrtest.go -output zattrtest.s -seed 42 -num 256

func attrtest() bool
6 changes: 1 addition & 5 deletions tests/textflag/attrtest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ package textflag

import "testing"

//go:generate go run make_attrtest.go -output zattrtest.s -seed 42 -num 256

func AttrTest() bool

func TestAttributes(t *testing.T) {
if !AttrTest() {
if !attrtest() {
t.Fail()
}
}
2 changes: 0 additions & 2 deletions tests/textflag/doc.go

This file was deleted.

2 changes: 1 addition & 1 deletion tests/textflag/make_attrtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func PrintAttributesTest(w io.Writer, as []attr.Attribute) {
_, self, _, _ := runtime.Caller(0)
fmt.Fprintf(w, "// Code generated by %s. DO NOT EDIT.\n\n", filepath.Base(self))
fmt.Fprintf(w, "#include \"textflag.h\"\n\n")
fmt.Fprintf(w, "TEXT ·AttrTest(SB), $0-1\n")
fmt.Fprintf(w, "TEXT ·attrtest(SB), $0-1\n")
fmt.Fprintf(w, "\tMOVB $0, ret+0(FP)\n")

for i, a := range as {
Expand Down
2 changes: 1 addition & 1 deletion tests/textflag/zattrtest.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "textflag.h"

TEXT ·AttrTest(SB), $0-1
TEXT ·attrtest(SB), $0-1
MOVB $0, ret+0(FP)
MOVW $(1), R8
MOVW $(NOPROF), R9
Expand Down

0 comments on commit 16c602d

Please sign in to comment.