Commit 311bbd2e by Abseil Team Committed by Andy Getz

Export of internal Abseil changes

--
ca5ce10fa5286f2bfb51890a37b547308b8d6d93 by Benjamin Barenblat <bbaren@google.com>:

Skip floating-point edge-case tests when using an x87

32-bit Intel CPUs use 80-bit floats for intermediate values, which can
change the results of floating point computations from what we normally
expect. Identify tests that are sensitive to the x87, and skip them when
we’re on 32-bit Intel.

PiperOrigin-RevId: 378722613

--
e5798bb017854e7f3b6d8721fed7dd553642b83d by Abseil Team <absl-team@google.com>:

Build without -Wl,-no-undefined.

PiperOrigin-RevId: 378690619

--
3587685a2c932405e401546ec383abcfbf8495c8 by Derek Mauro <dmauro@google.com>:

Update CCTZ BUILD file.

PiperOrigin-RevId: 378688996

--
06c7841b2bf8851410b716823b7ff9b42d86085e by Derek Mauro <dmauro@google.com>:

Change the CMake install test to use installed version of GoogleTest

PiperOrigin-RevId: 378537383

--
eaa8122a7062c56bed80e806344cca0c8325bf6f by Derek Mauro <dmauro@google.com>:

Internal change

PiperOrigin-RevId: 378525523

--
381f505cce894b8eec031a541855650c4aa46e64 by Abseil Team <absl-team@google.com>:

Mark btree_container::clear() with the ABSL_ATTRIBUTE_REINITIALIZES attribute.

This prevents false positives in the clang-tidy check bugprone-use-after-move;
it allows clear() to be called on a moved-from btree_container without any
warnings, and the btree_container will thereafter be regarded as initialized again.

PiperOrigin-RevId: 378472690
GitOrigin-RevId: ca5ce10fa5286f2bfb51890a37b547308b8d6d93
Change-Id: I4267246f418538c5baacb562d1a40213fb13f246
parent 8f921757
...@@ -19,10 +19,9 @@ ...@@ -19,10 +19,9 @@
# Fail on any error. Treat unset variables an error. Print commands as executed. # Fail on any error. Treat unset variables an error. Print commands as executed.
set -euox pipefail set -euox pipefail
source ci/cmake_common.sh
absl_dir=/abseil-cpp absl_dir=/abseil-cpp
absl_build_dir=/buildfs absl_build_dir=/buildfs
googletest_builddir=/googletest_builddir
project_dir="${absl_dir}"/CMake/install_test_project project_dir="${absl_dir}"/CMake/install_test_project
project_build_dir=/buildfs/project-build project_build_dir=/buildfs/project-build
...@@ -31,13 +30,30 @@ if [ "${LINK_TYPE:-}" = "DYNAMIC" ]; then ...@@ -31,13 +30,30 @@ if [ "${LINK_TYPE:-}" = "DYNAMIC" ]; then
build_shared_libs="ON" build_shared_libs="ON"
fi fi
# Build and install GoogleTest
mkdir "${googletest_builddir}"
pushd "${googletest_builddir}"
curl -L "${ABSL_GOOGLETEST_DOWNLOAD_URL}" --output "${ABSL_GOOGLETEST_COMMIT}".zip
unzip "${ABSL_GOOGLETEST_COMMIT}".zip
pushd "googletest-${ABSL_GOOGLETEST_COMMIT}"
mkdir build
pushd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="${build_shared_libs}" ..
make -j $(nproc)
make install
ldconfig
popd
popd
popd
# Run the LTS transformations # Run the LTS transformations
./create_lts.py 99998877 ./create_lts.py 99998877
# Install Abseil # Build and install Abseil
pushd "${absl_build_dir}" pushd "${absl_build_dir}"
cmake "${absl_dir}" \ cmake "${absl_dir}" \
-DABSL_GOOGLETEST_DOWNLOAD_URL="${ABSL_GOOGLETEST_DOWNLOAD_URL}" \ -DABSL_USE_EXTERNAL_GOOGLETEST=ON \
-DABSL_FIND_GOOGLETEST=ON \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON \ -DBUILD_TESTING=ON \
-DBUILD_SHARED_LIBS="${build_shared_libs}" -DBUILD_SHARED_LIBS="${build_shared_libs}"
......
...@@ -56,6 +56,7 @@ cc_library( ...@@ -56,6 +56,7 @@ cc_library(
srcs = ["log_severity.cc"], srcs = ["log_severity.cc"],
hdrs = ["log_severity.h"], hdrs = ["log_severity.h"],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
":config", ":config",
...@@ -159,6 +160,7 @@ cc_library( ...@@ -159,6 +160,7 @@ cc_library(
"internal/low_level_alloc.h", "internal/low_level_alloc.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = select({ linkopts = select({
"//absl:msvc_compiler": [], "//absl:msvc_compiler": [],
"//absl:clang-cl_compiler": [], "//absl:clang-cl_compiler": [],
...@@ -220,6 +222,7 @@ cc_library( ...@@ -220,6 +222,7 @@ cc_library(
"internal/unscaledcycleclock.h", "internal/unscaledcycleclock.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = select({ linkopts = select({
"//absl:msvc_compiler": [ "//absl:msvc_compiler": [
"-DEFAULTLIB:advapi32.lib", "-DEFAULTLIB:advapi32.lib",
...@@ -290,6 +293,7 @@ cc_library( ...@@ -290,6 +293,7 @@ cc_library(
srcs = ["internal/throw_delegate.cc"], srcs = ["internal/throw_delegate.cc"],
hdrs = ["internal/throw_delegate.h"], hdrs = ["internal/throw_delegate.h"],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
visibility = [ visibility = [
"//absl:__subpackages__", "//absl:__subpackages__",
...@@ -709,6 +713,7 @@ cc_library( ...@@ -709,6 +713,7 @@ cc_library(
srcs = ["internal/strerror.cc"], srcs = ["internal/strerror.cc"],
hdrs = ["internal/strerror.h"], hdrs = ["internal/strerror.h"],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
visibility = [ visibility = [
"//absl:__subpackages__", "//absl:__subpackages__",
......
...@@ -505,6 +505,7 @@ cc_library( ...@@ -505,6 +505,7 @@ cc_library(
], ],
hdrs = ["internal/hashtablez_sampler.h"], hdrs = ["internal/hashtablez_sampler.h"],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
":have_sse", ":have_sse",
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <iterator> #include <iterator>
#include <utility> #include <utility>
#include "absl/base/attributes.h"
#include "absl/base/internal/throw_delegate.h" #include "absl/base/internal/throw_delegate.h"
#include "absl/container/internal/btree.h" // IWYU pragma: export #include "absl/container/internal/btree.h" // IWYU pragma: export
#include "absl/container/internal/common.h" #include "absl/container/internal/common.h"
...@@ -176,7 +177,7 @@ class btree_container { ...@@ -176,7 +177,7 @@ class btree_container {
} }
// Utility routines. // Utility routines.
void clear() { tree_.clear(); } ABSL_ATTRIBUTE_REINITIALIZES void clear() { tree_.clear(); }
void swap(btree_container &other) { tree_.swap(other.tree_); } void swap(btree_container &other) { tree_.swap(other.tree_); }
void verify() const { tree_.verify(); } void verify() const { tree_.verify(); }
......
...@@ -51,6 +51,7 @@ cc_library( ...@@ -51,6 +51,7 @@ cc_library(
"internal/program_name.h", "internal/program_name.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
visibility = [ visibility = [
"//absl/flags:__pkg__", "//absl/flags:__pkg__",
...@@ -74,6 +75,7 @@ cc_library( ...@@ -74,6 +75,7 @@ cc_library(
"usage_config.h", "usage_config.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
":path_util", ":path_util",
...@@ -94,6 +96,7 @@ cc_library( ...@@ -94,6 +96,7 @@ cc_library(
"marshalling.h", "marshalling.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
"//absl/base:config", "//absl/base:config",
...@@ -113,6 +116,7 @@ cc_library( ...@@ -113,6 +116,7 @@ cc_library(
"internal/commandlineflag.h", "internal/commandlineflag.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
"//absl/base:config", "//absl/base:config",
...@@ -129,6 +133,7 @@ cc_library( ...@@ -129,6 +133,7 @@ cc_library(
"commandlineflag.h", "commandlineflag.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
":commandlineflag_internal", ":commandlineflag_internal",
...@@ -170,6 +175,7 @@ cc_library( ...@@ -170,6 +175,7 @@ cc_library(
"reflection.h", "reflection.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
":commandlineflag", ":commandlineflag",
...@@ -194,6 +200,7 @@ cc_library( ...@@ -194,6 +200,7 @@ cc_library(
"internal/sequence_lock.h", "internal/sequence_lock.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
visibility = ["//absl/base:__subpackages__"], visibility = ["//absl/base:__subpackages__"],
deps = [ deps = [
...@@ -244,6 +251,7 @@ cc_library( ...@@ -244,6 +251,7 @@ cc_library(
"internal/usage.h", "internal/usage.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
visibility = [ visibility = [
"//absl/flags:__pkg__", "//absl/flags:__pkg__",
...@@ -273,6 +281,7 @@ cc_library( ...@@ -273,6 +281,7 @@ cc_library(
"usage.h", "usage.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
":usage_internal", ":usage_internal",
...@@ -291,6 +300,7 @@ cc_library( ...@@ -291,6 +300,7 @@ cc_library(
"parse.h", "parse.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
":commandlineflag", ":commandlineflag",
......
...@@ -34,6 +34,7 @@ cc_library( ...@@ -34,6 +34,7 @@ cc_library(
], ],
hdrs = ["hash.h"], hdrs = ["hash.h"],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
":city", ":city",
......
...@@ -62,6 +62,7 @@ cc_library( ...@@ -62,6 +62,7 @@ cc_library(
], ],
hdrs = ["int128.h"], hdrs = ["int128.h"],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
":bits", ":bits",
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "absl/random/beta_distribution.h" #include "absl/random/beta_distribution.h"
#include <algorithm> #include <algorithm>
#include <cfloat>
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
#include <iterator> #include <iterator>
...@@ -558,6 +559,14 @@ TEST(BetaDistributionTest, StabilityTest) { ...@@ -558,6 +559,14 @@ TEST(BetaDistributionTest, StabilityTest) {
// dependencies of the distribution change, such as RandU64ToDouble, then this // dependencies of the distribution change, such as RandU64ToDouble, then this
// is also likely to change. // is also likely to change.
TEST(BetaDistributionTest, AlgorithmBounds) { TEST(BetaDistributionTest, AlgorithmBounds) {
#if (defined(__i386__) || defined(_M_IX86)) && FLT_EVAL_METHOD != 0
// We're using an x87-compatible FPU, and intermediate operations are
// performed with 80-bit floats. This produces slightly different results from
// what we expect below.
GTEST_SKIP()
<< "Skipping the test because we detected x87 floating-point semantics";
#endif
{ {
absl::random_internal::sequence_urbg urbg( absl::random_internal::sequence_urbg urbg(
{0x7fbe76c8b4395800ull, 0x8000000000000000ull}); {0x7fbe76c8b4395800ull, 0x8000000000000000ull});
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "absl/random/distributions.h" #include "absl/random/distributions.h"
#include <cfloat>
#include <cmath> #include <cmath>
#include <cstdint> #include <cstdint>
#include <random> #include <random>
...@@ -224,6 +225,15 @@ TEST_F(RandomDistributionsTest, UniformNoBounds) { ...@@ -224,6 +225,15 @@ TEST_F(RandomDistributionsTest, UniformNoBounds) {
TEST_F(RandomDistributionsTest, UniformNonsenseRanges) { TEST_F(RandomDistributionsTest, UniformNonsenseRanges) {
// The ranges used in this test are undefined behavior. // The ranges used in this test are undefined behavior.
// The results are arbitrary and subject to future changes. // The results are arbitrary and subject to future changes.
#if (defined(__i386__) || defined(_M_IX86)) && FLT_EVAL_METHOD != 0
// We're using an x87-compatible FPU, and intermediate operations can be
// performed with 80-bit floats. This produces slightly different results from
// what we expect below.
GTEST_SKIP()
<< "Skipping the test because we detected x87 floating-point semantics";
#endif
absl::InsecureBitGen gen; absl::InsecureBitGen gen;
// <uint> // <uint>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "absl/random/exponential_distribution.h" #include "absl/random/exponential_distribution.h"
#include <algorithm> #include <algorithm>
#include <cfloat>
#include <cmath> #include <cmath>
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
...@@ -384,6 +385,15 @@ TEST(ExponentialDistributionTest, StabilityTest) { ...@@ -384,6 +385,15 @@ TEST(ExponentialDistributionTest, StabilityTest) {
TEST(ExponentialDistributionTest, AlgorithmBounds) { TEST(ExponentialDistributionTest, AlgorithmBounds) {
// Relies on absl::uniform_real_distribution, so some of these comments // Relies on absl::uniform_real_distribution, so some of these comments
// reference that. // reference that.
#if (defined(__i386__) || defined(_M_IX86)) && FLT_EVAL_METHOD != 0
// We're using an x87-compatible FPU, and intermediate operations can be
// performed with 80-bit floats. This produces slightly different results from
// what we expect below.
GTEST_SKIP()
<< "Skipping the test because we detected x87 floating-point semantics";
#endif
absl::exponential_distribution<double> dist; absl::exponential_distribution<double> dist;
{ {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "absl/random/uniform_real_distribution.h" #include "absl/random/uniform_real_distribution.h"
#include <cfloat>
#include <cmath> #include <cmath>
#include <cstdint> #include <cstdint>
#include <iterator> #include <iterator>
...@@ -70,6 +71,14 @@ using RealTypes = ...@@ -70,6 +71,14 @@ using RealTypes =
TYPED_TEST_SUITE(UniformRealDistributionTest, RealTypes); TYPED_TEST_SUITE(UniformRealDistributionTest, RealTypes);
TYPED_TEST(UniformRealDistributionTest, ParamSerializeTest) { TYPED_TEST(UniformRealDistributionTest, ParamSerializeTest) {
#if (defined(__i386__) || defined(_M_IX86)) && FLT_EVAL_METHOD != 0
// We're using an x87-compatible FPU, and intermediate operations are
// performed with 80-bit floats. This produces slightly different results from
// what we expect below.
GTEST_SKIP()
<< "Skipping the test because we detected x87 floating-point semantics";
#endif
using param_type = using param_type =
typename absl::uniform_real_distribution<TypeParam>::param_type; typename absl::uniform_real_distribution<TypeParam>::param_type;
......
...@@ -40,6 +40,7 @@ cc_library( ...@@ -40,6 +40,7 @@ cc_library(
"status_payload_printer.h", "status_payload_printer.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
deps = [ deps = [
"//absl/base:atomic_hook", "//absl/base:atomic_hook",
"//absl/base:config", "//absl/base:config",
...@@ -76,6 +77,7 @@ cc_library( ...@@ -76,6 +77,7 @@ cc_library(
"statusor.h", "statusor.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
deps = [ deps = [
":status", ":status",
"//absl/base:core_headers", "//absl/base:core_headers",
......
...@@ -66,6 +66,7 @@ cc_library( ...@@ -66,6 +66,7 @@ cc_library(
"substitute.h", "substitute.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
deps = [ deps = [
":internal", ":internal",
"//absl/base", "//absl/base",
...@@ -96,6 +97,7 @@ cc_library( ...@@ -96,6 +97,7 @@ cc_library(
"internal/utf8.h", "internal/utf8.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
deps = [ deps = [
"//absl/base:config", "//absl/base:config",
"//absl/base:core_headers", "//absl/base:core_headers",
...@@ -278,6 +280,7 @@ cc_library( ...@@ -278,6 +280,7 @@ cc_library(
"internal/cord_rep_ring_reader.h", "internal/cord_rep_ring_reader.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
visibility = [ visibility = [
"//visibility:private", "//visibility:private",
], ],
...@@ -327,6 +330,7 @@ cc_library( ...@@ -327,6 +330,7 @@ cc_library(
"cord.h", "cord.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
deps = [ deps = [
":cord_internal", ":cord_internal",
":cordz_functions", ":cordz_functions",
...@@ -355,6 +359,7 @@ cc_library( ...@@ -355,6 +359,7 @@ cc_library(
srcs = ["internal/cordz_handle.cc"], srcs = ["internal/cordz_handle.cc"],
hdrs = ["internal/cordz_handle.h"], hdrs = ["internal/cordz_handle.h"],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
visibility = [ visibility = [
"//absl:__subpackages__", "//absl:__subpackages__",
], ],
...@@ -371,6 +376,7 @@ cc_library( ...@@ -371,6 +376,7 @@ cc_library(
srcs = ["internal/cordz_info.cc"], srcs = ["internal/cordz_info.cc"],
hdrs = ["internal/cordz_info.h"], hdrs = ["internal/cordz_info.h"],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
visibility = [ visibility = [
"//absl:__subpackages__", "//absl:__subpackages__",
], ],
...@@ -995,6 +1001,7 @@ cc_library( ...@@ -995,6 +1001,7 @@ cc_library(
"internal/str_format/parser.h", "internal/str_format/parser.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
visibility = ["//visibility:private"], visibility = ["//visibility:private"],
deps = [ deps = [
":strings", ":strings",
......
...@@ -36,6 +36,7 @@ cc_library( ...@@ -36,6 +36,7 @@ cc_library(
"internal/graphcycles.h", "internal/graphcycles.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
visibility = [ visibility = [
"//absl:__subpackages__", "//absl:__subpackages__",
...@@ -87,6 +88,7 @@ cc_library( ...@@ -87,6 +88,7 @@ cc_library(
"notification.h", "notification.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = select({ linkopts = select({
"//absl:msvc_compiler": [], "//absl:msvc_compiler": [],
"//absl:clang-cl_compiler": [], "//absl:clang-cl_compiler": [],
......
...@@ -43,6 +43,7 @@ cc_library( ...@@ -43,6 +43,7 @@ cc_library(
"time.h", "time.h",
], ],
copts = ABSL_DEFAULT_COPTS, copts = ABSL_DEFAULT_COPTS,
features = ["-no_undefined"],
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
"//absl/base", "//absl/base",
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#endif #endif
#include <chrono> // NOLINT(build/c++11) #include <chrono> // NOLINT(build/c++11)
#include <cfloat>
#include <cmath> #include <cmath>
#include <cstdint> #include <cstdint>
#include <ctime> #include <ctime>
...@@ -1390,6 +1391,14 @@ void VerifyApproxSameAsMul(double time_as_seconds, int* const misses) { ...@@ -1390,6 +1391,14 @@ void VerifyApproxSameAsMul(double time_as_seconds, int* const misses) {
// Seconds(point) returns a duration near point * Seconds(1.0). (They may // Seconds(point) returns a duration near point * Seconds(1.0). (They may
// not be exactly equal due to fused multiply/add contraction.) // not be exactly equal due to fused multiply/add contraction.)
TEST(Duration, ToDoubleSecondsCheckEdgeCases) { TEST(Duration, ToDoubleSecondsCheckEdgeCases) {
#if (defined(__i386__) || defined(_M_IX86)) && FLT_EVAL_METHOD != 0
// We're using an x87-compatible FPU, and intermediate operations can be
// performed with 80-bit floats. This means the edge cases are different than
// what we expect here, so just skip this test.
GTEST_SKIP()
<< "Skipping the test because we detected x87 floating-point semantics";
#endif
constexpr uint32_t kTicksPerSecond = absl::time_internal::kTicksPerSecond; constexpr uint32_t kTicksPerSecond = absl::time_internal::kTicksPerSecond;
constexpr auto duration_tick = absl::time_internal::MakeDuration(0, 1u); constexpr auto duration_tick = absl::time_internal::MakeDuration(0, 1u);
int misses = 0; int misses = 0;
......
...@@ -45,6 +45,7 @@ cc_library( ...@@ -45,6 +45,7 @@ cc_library(
hdrs = [ hdrs = [
"include/cctz/civil_time.h", "include/cctz/civil_time.h",
], ],
features = ["-no_undefined"],
textual_hdrs = ["include/cctz/civil_time_detail.h"], textual_hdrs = ["include/cctz/civil_time_detail.h"],
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = ["//absl/base:config"], deps = ["//absl/base:config"],
...@@ -74,6 +75,7 @@ cc_library( ...@@ -74,6 +75,7 @@ cc_library(
"include/cctz/time_zone.h", "include/cctz/time_zone.h",
"include/cctz/zone_info_source.h", "include/cctz/zone_info_source.h",
], ],
features = ["-no_undefined"],
linkopts = select({ linkopts = select({
":osx": [ ":osx": [
"-framework Foundation", "-framework Foundation",
......
...@@ -36,8 +36,11 @@ for link_type in ${LINK_TYPE}; do ...@@ -36,8 +36,11 @@ for link_type in ${LINK_TYPE}; do
--tmpfs=/abseil-cpp:exec \ --tmpfs=/abseil-cpp:exec \
--workdir=/abseil-cpp \ --workdir=/abseil-cpp \
--cap-add=SYS_PTRACE \ --cap-add=SYS_PTRACE \
-e "ABSL_GOOGLETEST_COMMIT=${ABSL_GOOGLETEST_COMMIT}" \
-e "ABSL_GOOGLETEST_DOWNLOAD_URL=${ABSL_GOOGLETEST_DOWNLOAD_URL}" \
-e "LINK_TYPE=${link_type}" \ -e "LINK_TYPE=${link_type}" \
--rm \ --rm \
${DOCKER_EXTRA_ARGS:-} \
${DOCKER_CONTAINER} \ ${DOCKER_CONTAINER} \
/bin/bash -c "cp -r /abseil-cpp-ro/* . && CMake/install_test_project/test.sh" /bin/bash -c "cp -r /abseil-cpp-ro/* . && CMake/install_test_project/test.sh"
done done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment