Files
garble/testdata/scripts/asm.txt
Andrew LeFevre d679944408 Strip all filename and position info when -tiny is passed (#128)
Co-authored-by: pagran <pagran@protonmail.com>
Co-authored-by: lu4p <lu4p@pm.me>
2020-09-07 17:24:40 +02:00

55 lines
862 B
Plaintext

env GOPRIVATE=test/main
garble build
exec ./main
cmp stderr main.stderr
binsubstr main$exe 'privateAdd' 'PublicAdd'
[short] stop # no need to verify this with -short
garble -tiny build
exec ./main
cmp stderr main.stderr
binsubstr main$exe 'privateAdd' 'PublicAdd'
go build
exec ./main
cmp stderr main.stderr
-- go.mod --
module test/main
-- main.go --
package main
import (
"test/main/imported"
)
func privateAdd(x, y int64) int64
func main() {
println(privateAdd(1, 2))
println(imported.PublicAdd(3, 4))
}
-- main.s --
TEXT ·privateAdd(SB),$0-24
MOVQ x+0(FP), BX
MOVQ y+8(FP), BP
ADDQ BP, BX
MOVQ BX, ret+16(FP)
RET
-- imported/imported.go --
package imported
func PublicAdd(x, y int64) int64
-- imported/imported.s --
TEXT ·PublicAdd(SB),$0-24
MOVQ x+0(FP), BX
MOVQ y+8(FP), BP
ADDQ BP, BX
MOVQ BX, ret+16(FP)
RET
-- main.stderr --
3
7