Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert b0e7e0dca5478e598c8e336a4e7ec22eb95a7cff #190

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions make/hotspot/lib/CompileGtest.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
$(GTEST_FRAMEWORK_SRC)/googlemock/src, \
INCLUDE_FILES := gtest-all.cc gmock-all.cc, \
DISABLED_WARNINGS_gcc := undef unused-result format-nonliteral maybe-uninitialized, \
DISABLED_WARNINGS_clang := deprecated-copy undef unused-result format-nonliteral, \
DISABLED_WARNINGS_clang := undef unused-result format-nonliteral, \
CFLAGS := $(JVM_CFLAGS) \
-I$(GTEST_FRAMEWORK_SRC)/googletest \
-I$(GTEST_FRAMEWORK_SRC)/googletest/include \
Expand Down Expand Up @@ -103,7 +103,7 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
DISABLED_WARNINGS_gcc := $(DISABLED_WARNINGS_gcc) \
undef stringop-overflow, \
DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang) \
deprecated-copy undef switch format-nonliteral tautological-undefined-compare \
undef switch format-nonliteral tautological-undefined-compare \
self-assign-overloaded, \
DISABLED_WARNINGS_microsoft := $(DISABLED_WARNINGS_microsoft), \
LDFLAGS := $(JVM_LDFLAGS), \
Expand Down
4 changes: 1 addition & 3 deletions make/hotspot/lib/JvmFlags.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,10 @@ JVM_CFLAGS_TARGET_DEFINES += \
#

ifeq ($(DEBUG_LEVEL), release)
# release builds disable uses of assert macro from <assert.h>.
JVM_CFLAGS_DEBUGLEVEL := -DNDEBUG
# For hotspot, release builds differ internally between "optimized" and "product"
# in that "optimize" does not define PRODUCT.
ifneq ($(HOTSPOT_DEBUG_LEVEL), optimized)
JVM_CFLAGS_DEBUGLEVEL += -DPRODUCT
JVM_CFLAGS_DEBUGLEVEL := -DPRODUCT
endif
else ifeq ($(DEBUG_LEVEL), fastdebug)
JVM_CFLAGS_DEBUGLEVEL := -DASSERT
Expand Down
36 changes: 0 additions & 36 deletions src/hotspot/share/utilities/vmassert_reinstall.hpp

This file was deleted.

45 changes: 0 additions & 45 deletions src/hotspot/share/utilities/vmassert_uninstall.hpp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 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
Expand All @@ -24,13 +24,10 @@
#include "precompiled.hpp"
#include "gc/shared/memset_with_concurrent_readers.hpp"
#include "utilities/globalDefinitions.hpp"
#include "unittest.hpp"

#include "utilities/vmassert_uninstall.hpp"
#include <string.h>
#include <sstream>
#include "utilities/vmassert_reinstall.hpp"

#include "unittest.hpp"

static unsigned line_byte(const char* line, size_t i) {
return unsigned(line[i]) & 0xFF;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@

#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahNumberSeq.hpp"
#include "utilities/ostream.hpp"

#include "utilities/vmassert_uninstall.hpp"
#include <iostream>
#include "utilities/vmassert_reinstall.hpp"

#include "unittest.hpp"
#include "utilities/ostream.hpp"

class ShenandoahNumberSeqTest: public ::testing::Test {
protected:
Expand Down
8 changes: 3 additions & 5 deletions test/hotspot/gtest/jfr/test_networkUtilization.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019, 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
Expand Down Expand Up @@ -42,13 +42,11 @@
#include "utilities/globalDefinitions.hpp"
#include "utilities/growableArray.hpp"

#include "utilities/vmassert_uninstall.hpp"
#include "unittest.hpp"

#include <vector>
#include <list>
#include <map>
#include "utilities/vmassert_reinstall.hpp"

#include "unittest.hpp"

namespace {

Expand Down
19 changes: 15 additions & 4 deletions test/hotspot/gtest/unittest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,29 @@
#undef F1
#undef F2

#include "utilities/vmassert_uninstall.hpp"
// A work around for GCC math header bug leaving isfinite() undefined,
// see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14608
#include "utilities/globalDefinitions.hpp"

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "utilities/vmassert_reinstall.hpp"

#ifdef UNDEFINED_Log
#define Log(...) LogImpl<LOG_TAGS(__VA_ARGS__)> // copied from logging/log.hpp
#undef UNDEFINED_Log
#endif

// Wrapper around os::exit so we don't need to include os.hpp here.
extern void gtest_exit_from_child_vm(int num);
// gtest/gtest.h includes assert.h which will define the assert macro, but hotspot has its
// own standards incompatible assert macro that takes two parameters.
// The workaround is to undef assert and then re-define it. The re-definition
// must unfortunately be copied since debug.hpp might already have been
// included and a second include wouldn't work due to the header guards in debug.hpp.
#ifdef assert
#undef assert
#ifdef vmassert
#define assert(p, ...) vmassert(p, __VA_ARGS__)
#endif
#endif

#define CONCAT(a, b) a ## b

Expand Down
Loading