< prev index next > test/hotspot/gtest/runtime/test_classPrinter.cpp
Print this page
/*
- * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
* questions.
*/
#include "classfile/classPrinter.hpp"
#include "memory/resourceArea.hpp"
+ #include "runtime/arguments.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/javaThread.hpp"
#include "utilities/ostream.hpp"
#include "unittest.hpp"
ASSERT_THAT(o3, HasSubstr("class: java/lang/Integer mirror:")) << "must find java/lang/Integer";
ASSERT_THAT(o3, HasSubstr("InstanceKlass: java.lang.Integer {0x")) << "must print InstanceKlass";
ASSERT_THAT(o3, HasSubstr("Java mirror oop for java/lang/Integer:")) << "must print mirror oop";
#if GTEST_USES_POSIX_RE
// Complex regex not available on Windows
- ASSERT_THAT(o3, ContainsRegex("public static final 'MIN_VALUE' 'I'.* -2147483648 [(]0x80000000[)]")) << "must print static fields";
+ const char* re = Arguments::is_valhalla_enabled()
+ ? "public static final value 'MIN_VALUE' 'I'.* -2147483648 [(]0x80000000[)]"
+ : "public static final 'MIN_VALUE' 'I'.* -2147483648 [(]0x80000000[)]";
+
+ ASSERT_THAT(o3, ContainsRegex(re)) << "must print static fields";
#endif
}
TEST_VM(ClassPrinter, print_methods) {
JavaThread* THREAD = JavaThread::current();
< prev index next >