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

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

View as plain text