aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2023-01-23 15:13:20 +0100
committerQuim Muntal <quimmuntal@gmail.com>2023-01-24 08:46:11 +0000
commite39c7a37f0f1a992eb65202d05c3148524c5c0ef (patch)
treee62c7d9fd91f01bddf439281cf3950287436f427 /src/runtime
parent030ca34f5786f0b924dcab26379ee2f82104220d (diff)
downloadgo-e39c7a37f0f1a992eb65202d05c3148524c5c0ef.tar.xz
runtime: run TestVectoredHandlerDontCrashOnLibrary on 386 and arm64
This CL updates TestVectoredHandlerDontCrashOnLibrary so it can run on windows/386 and windows/arm64. It still can't run on windows/arm as it does not support c-shared buildmode (see #43800). Change-Id: Id1577687e165e77d27633c632634ecf86e6e9d6f Reviewed-on: https://go-review.googlesource.com/c/go/+/463117 Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Quim Muntal <quimmuntal@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/signal_windows_test.go7
-rw-r--r--src/runtime/testdata/testwinlib/main.c9
2 files changed, 13 insertions, 3 deletions
diff --git a/src/runtime/signal_windows_test.go b/src/runtime/signal_windows_test.go
index c9b8e90118..5648185cab 100644
--- a/src/runtime/signal_windows_test.go
+++ b/src/runtime/signal_windows_test.go
@@ -79,8 +79,11 @@ func TestVectoredHandlerDontCrashOnLibrary(t *testing.T) {
if *flagQuick {
t.Skip("-quick")
}
- if runtime.GOARCH != "amd64" {
- t.Skip("this test can only run on windows/amd64")
+ if runtime.GOARCH == "arm" {
+ //TODO: remove this skip and update testwinlib/main.c
+ // once windows/arm supports c-shared buildmode.
+ // See go.dev/issues/43800.
+ t.Skip("this test can't run on windows/arm")
}
testenv.MustHaveGoBuild(t)
testenv.MustHaveCGO(t)
diff --git a/src/runtime/testdata/testwinlib/main.c b/src/runtime/testdata/testwinlib/main.c
index c3fe3cb071..55ee6571d7 100644
--- a/src/runtime/testdata/testwinlib/main.c
+++ b/src/runtime/testdata/testwinlib/main.c
@@ -11,8 +11,15 @@ LONG WINAPI customExceptionHandlder(struct _EXCEPTION_POINTERS *ExceptionInfo)
exceptionCount++;
// prepare context to resume execution
CONTEXT *c = ExceptionInfo->ContextRecord;
- c->Rip = *(ULONG_PTR *)c->Rsp;
+#ifdef _AMD64_
+ c->Rip = *(DWORD64 *)c->Rsp;
c->Rsp += 8;
+#elif defined(_X86_)
+ c->Eip = *(DWORD *)c->Esp;
+ c->Esp += 4;
+#else
+ c->Pc = c->Lr;
+#endif
return EXCEPTION_CONTINUE_EXECUTION;
}
return EXCEPTION_CONTINUE_SEARCH;