diff options
| author | Alex Brainman <alex.brainman@gmail.com> | 2012-01-20 12:59:44 +1100 |
|---|---|---|
| committer | Alex Brainman <alex.brainman@gmail.com> | 2012-01-20 12:59:44 +1100 |
| commit | 8d6958fc041eee42e78ba3c20569c71c35795b8b (patch) | |
| tree | 92e7c388f041d3dffd22de4bd30cb4aa4923283c /src | |
| parent | 7fc4c07172b7b6feb2da345511ad439fedaf876b (diff) | |
| download | go-8d6958fc041eee42e78ba3c20569c71c35795b8b.tar.xz | |
misc/cgo/test: make tests run on windows
- use proper Win64 gcc calling convention when
calling initcgo on amd64
- increase g0 stack size to 64K on amd64 to make
it the same as 386
- implement C.sleep
- do not use C.stat, since it is renamed to C._stat by mingw
- use fopen to implement TestErrno, since C.strtol
always succeeds on windows
- skip TestSetEnv on windows, because os.Setenv
sets windows process environment, while C.getenv
inspects internal C runtime variable instead
R=golang-dev, vcc.163, rsc
CC=golang-dev
https://golang.org/cl/5500094
Diffstat (limited to 'src')
| -rw-r--r-- | src/pkg/runtime/asm_amd64.s | 6 | ||||
| -rwxr-xr-x | src/run.bash | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/pkg/runtime/asm_amd64.s b/src/pkg/runtime/asm_amd64.s index 9053334993..308a66036e 100644 --- a/src/pkg/runtime/asm_amd64.s +++ b/src/pkg/runtime/asm_amd64.s @@ -16,7 +16,7 @@ TEXT _rt0_amd64(SB),7,$-8 // create istack out of the given (operating system) stack. // initcgo may update stackguard. MOVQ $runtime·g0(SB), DI - LEAQ (-8192+104)(SP), BX + LEAQ (-64*1024+104)(SP), BX MOVQ BX, g_stackguard(DI) MOVQ SP, g_stackbase(DI) @@ -24,7 +24,9 @@ TEXT _rt0_amd64(SB),7,$-8 MOVQ initcgo(SB), AX TESTQ AX, AX JZ needtls - CALL AX // g0 already in DI + // g0 already in DI + MOVQ DI, CX // Win64 uses CX for first parameter + CALL AX CMPL runtime·iswindows(SB), $0 JEQ ok diff --git a/src/run.bash b/src/run.bash index 2741637a80..8cc04a71fc 100755 --- a/src/run.bash +++ b/src/run.bash @@ -97,7 +97,6 @@ gomake clean ) || exit $? [ "$CGO_ENABLED" != 1 ] || -[ "$GOHOSTOS" == windows ] || (xcd ../misc/cgo/test gomake clean gotest |
