From 7b6e657831cee1648b9fe4cba91eccdbd5c5aceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20H=C3=BCbner?= Date: Wed, 28 Jan 2026 10:13:09 +0000 Subject: [PATCH] Ignore inlining with MSVC. --- test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java | 8 ++++---- test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarf.c | 5 ++++- .../jtreg/runtime/ErrorHandling/libTestDwarfHelper.h | 5 ++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java index 805df110e9d..6fe00498797 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java @@ -108,10 +108,10 @@ public class TestDwarf { if (Platform.isX64() || Platform.isX86()) { // Not all platforms raise SIGFPE but x86_32 and x86_64 do. runAndCheck(new Flags(TestDwarf.class.getCanonicalName(), "nativeDivByZero"), - new DwarfConstraint(0, "Java_TestDwarf_crashNativeDivByZero", "libTestDwarf.c", 59)); + new DwarfConstraint(0, "Java_TestDwarf_crashNativeDivByZero", "libTestDwarf.c", 62)); runAndCheck(new Flags(TestDwarf.class.getCanonicalName(), "nativeMultipleMethods"), - new DwarfConstraint(0, "foo", "libTestDwarf.c", 42), - new DwarfConstraint(1, "Java_TestDwarf_crashNativeMultipleMethods", "libTestDwarf.c", 70)); + new DwarfConstraint(0, "foo", "libTestDwarf.c", 45), + new DwarfConstraint(1, "Java_TestDwarf_crashNativeMultipleMethods", "libTestDwarf.c", 73)); } // Null pointer dereferences exhibit different behaviour depending on if GCC or Clang is used. // When using GCC, the VM will crash gracefully and generate a hs_err which can be parsed. @@ -119,7 +119,7 @@ public class TestDwarf { // Since runAndCheck needs an hs_err file, we have to skip this subtest. if (!isUsingClang()) { runAndCheck(new Flags(TestDwarf.class.getCanonicalName(), "nativeDereferenceNull"), - new DwarfConstraint(0, "dereference_null", "libTestDwarfHelper.h", 46)); + new DwarfConstraint(0, "dereference_null", "libTestDwarfHelper.h", 49)); } } diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarf.c b/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarf.c index 6d2051d2126..c2a8d8168f1 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarf.c +++ b/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarf.c @@ -29,7 +29,10 @@ int result = 0; int limit = 20; // Explicitly don't inline: foo is large enough that GCC won't inline it, but Clang might. -__attribute__((noinline)) void foo(int x) { +#if !defined(_MSC_VER) +__attribute__((noinline)) +#endif +void foo(int x) { printf("foo3:"); printf(" %d\n", x); for (int i = 0; i < limit; i++) { diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarfHelper.h b/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarfHelper.h index bca362ccd65..9f9ef33add2 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarfHelper.h +++ b/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarfHelper.h @@ -41,7 +41,10 @@ void unused4() { void unused5() { } -__attribute__((noinline)) EXPORT void dereference_null() { +#if !defined(_MSC_VER) +__attribute__((noinline)) +#endif +EXPORT void dereference_null() { int* x = (int*)0; *x = 34; // Crash }