@ -4,15 +4,14 @@
exec go build main.go
exec go build main.go
exec ./main
exec ./main
cmp stderr main.stderr
cmp stderr main.stderr
grep $WORK main
# The default build includes DWARF and the symbol table.
# The default build includes DWARF and the symbol table.
exec readelf --section-headers main
exec readelf --section-headers main
stdout 'debug_info'
stdout 'debug_info'
stdout '\.symtab'
stdout '\.symtab'
# The default build includes full non-trimmed paths.
# The default build includes full non-trimmed paths, as well as our names .
grep $WORK main
bingrep main$exe ${WORK@R} 'globalVar' 'globalFunc'
# Check that we fail if the user forgot -trimpath.
# Check that we fail if the user forgot -trimpath.
! exec go build -a -toolexec=garble main.go
! exec go build -a -toolexec=garble main.go
@ -27,15 +26,13 @@ exec readelf --section-headers main
! stdout 'debug_info'
! stdout 'debug_info'
! stdout '\.symtab'
! stdout '\.symtab'
! grep $WORK main
! bingrep main$exe ${WORK@R} 'globalVar' 'globalFunc'
! grep 'globalVar' main
! grep 'globalFunc' main
# Finally, check that the 'garble build' shortcut works.
# Finally, check that the 'garble build' shortcut works.
# cp main main_old
# cp main main_old
garble build main.go
garble build main.go
! grep 'globalVar' main
! bin grep main$exe 'globalVar'
# cmp main main_old
# bin cmp main main_old
-- main.go --
-- main.go --
package main
package main