Delta Between Two Patch Sets: misc/cgo/testshared/shared.go
Issue 9738047 :
code review 9738047: runtime: Add shared library support (linux/amd64)
Left Patch Set: diff -r a3545f2fb0a2 https://go.googlecode.com/hg/
Right Patch Set: diff -r 3833ddddde2b1a2741a396c4e965b04d525a133b https://go.googlecode.com/hg/
Use n/p to move between diff chunks;
N/P to move between comments.
Please Sign in to add in-line comments.
Jump to:
misc/cgo/testshared/main.c
misc/cgo/testshared/mainadv.c
misc/cgo/testshared/mainmult.c
misc/cgo/testshared/shared.go
misc/cgo/testshared/shared2.go
misc/cgo/testshared/test.bash
src/cmd/cgo/out.go
src/pkg/runtime/asm_386.s
src/pkg/runtime/asm_amd64.s
src/pkg/runtime/asm_arm.s
src/pkg/runtime/cgo/gcc_sharedlib_linux.c
src/pkg/runtime/cgo/libcgo.h
src/pkg/runtime/cgo/sharedlib_linux.c
src/pkg/runtime/os_linux_arm.c
src/pkg/runtime/proc.c
src/pkg/runtime/rt0_linux_amd64.s
src/pkg/runtime/rt0_linux_arm.s
src/pkg/runtime/runtime.h
src/pkg/runtime/runtime.c
src/pkg/runtime/softfloat_arm.c
src/pkg/runtime/vdso_linux_amd64.c
src/run.bash
LEFT RIGHT
1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
1 package main 5 package main
2 6
3 import "C" 7 import "C"
8
9 import (
10 "fmt"
11 "os"
12 "time"
13 )
4 14
5 var v int 15 var v int
6 16
7 //export Go_callback 17 //export Go_callback
8 func Go_callback() int { 18 func Go_callback() int {
19 // Sleep a little to allow to test concurrent runtime initialization fro
m mainadv.c
20 time.Sleep(200 * time.Millisecond)
9 return v 21 return v
22 }
23
24 //export Go_testEnv
25 func Go_testEnv() {
26 env := os.Getenv("TEST_ENV")
27 if env != "test" {
28 panic(fmt.Errorf("Expected TEST_ENV=%s, but got %s", "test", env
))
29 }
10 } 30 }
11 31
12 func main() { 32 func main() {
13 v = 42 33 v = 42
14 } 34 }
LEFT RIGHT