...

Text file src/cmd/go/testdata/script/vet_asm.txt

Documentation: cmd/go/testdata/script

     1env GO111MODULE=off
     2
     3# Issue 27665. Verify that "go vet" analyzes non-Go files.
     4
     5[!GOARCH:amd64] skip
     6! go vet -asmdecl a
     7stderr 'f: invalid MOVW of x'
     8
     9# -c flag shows context
    10! go vet -c=2 -asmdecl a
    11stderr '...invalid MOVW...'
    12stderr '1	.*TEXT'
    13stderr '2		MOVW'
    14stderr '3		RET'
    15stderr '4'
    16
    17# -json causes success, even with diagnostics and errors.
    18go vet -json -asmdecl a
    19stderr '"a": {'
    20stderr   '"asmdecl":'
    21stderr     '"posn": ".*asm.s:2:1",'
    22stderr     '"message": ".*invalid MOVW.*"'
    23
    24-- a/a.go --
    25package a
    26
    27func f(x int8)
    28
    29-- a/asm.s --
    30TEXT ·f(SB),0,$0-1
    31	MOVW	x+0(FP), AX
    32	RET

View as plain text