You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
935 B
Plaintext
69 lines
935 B
Plaintext
# Test that garble keeps init functions in the order they were declared in.
|
|
|
|
garble build
|
|
exec ./main
|
|
cmp stderr main.stderr
|
|
|
|
[short] stop # no need to verify this with -short
|
|
|
|
go build
|
|
exec ./main
|
|
cmp stderr main.stderr
|
|
|
|
-- go.mod --
|
|
module test/main
|
|
-- main.go --
|
|
package main
|
|
|
|
var exploded []byte
|
|
|
|
func init() {
|
|
exploded = append(exploded, 'B')
|
|
}
|
|
|
|
func init() {
|
|
exploded = append(exploded, 'i')
|
|
}
|
|
|
|
func init() {
|
|
exploded = append(exploded, 'g')
|
|
}
|
|
|
|
func init() {
|
|
exploded = append(exploded, ' ')
|
|
}
|
|
|
|
func init() {
|
|
exploded = append(exploded, 'C')
|
|
}
|
|
|
|
func init() {
|
|
exploded = append(exploded, 'h')
|
|
}
|
|
|
|
func init() {
|
|
exploded = append(exploded, 'u')
|
|
}
|
|
|
|
func init() {
|
|
exploded = append(exploded, 'n')
|
|
}
|
|
|
|
func init() {
|
|
exploded = append(exploded, 'g')
|
|
}
|
|
|
|
func init() {
|
|
exploded = append(exploded, 'u')
|
|
}
|
|
|
|
func init() {
|
|
exploded = append(exploded, 's')
|
|
}
|
|
|
|
func main() {
|
|
println(string(exploded))
|
|
}
|
|
-- main.stderr --
|
|
Big Chungus
|