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.
31 lines
408 B
Plaintext
31 lines
408 B
Plaintext
5 years ago
|
garble build
|
||
|
exec ./main
|
||
|
cmp stdout main.stdout
|
||
|
binsubstr main$exe 'privateAdd'
|
||
|
|
||
|
[short] stop # no need to verify this with -short
|
||
|
|
||
|
go build
|
||
|
exec ./main
|
||
|
cmp stdout main.stdout
|
||
|
|
||
|
-- go.mod --
|
||
|
module foo.com/main
|
||
|
-- main.go --
|
||
|
package main
|
||
|
|
||
|
/*
|
||
|
static int privateAdd(int a, int b) {
|
||
|
return a + b;
|
||
|
}
|
||
|
*/
|
||
|
import "C"
|
||
|
|
||
|
import "fmt"
|
||
|
|
||
|
func main() {
|
||
|
fmt.Println(C.privateAdd(C.int(1), C.int(2)))
|
||
|
}
|
||
|
-- main.stdout --
|
||
|
3
|