diff options
Diffstat (limited to 'absl/time')
-rw-r--r-- | absl/time/BUILD.bazel | 1 | ||||
-rw-r--r-- | absl/time/duration_test.cc | 9 | ||||
-rw-r--r-- | absl/time/internal/cctz/BUILD.bazel | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/absl/time/BUILD.bazel b/absl/time/BUILD.bazel index 3e25ca26..4700616d 100644 --- a/absl/time/BUILD.bazel +++ b/absl/time/BUILD.bazel @@ -43,6 +43,7 @@ cc_library( "time.h", ], copts = ABSL_DEFAULT_COPTS, + features = ["-no_undefined"], linkopts = ABSL_DEFAULT_LINKOPTS, deps = [ "//absl/base", diff --git a/absl/time/duration_test.cc b/absl/time/duration_test.cc index a3617e74..b7209e1c 100644 --- a/absl/time/duration_test.cc +++ b/absl/time/duration_test.cc @@ -17,6 +17,7 @@ #endif #include <chrono> // NOLINT(build/c++11) +#include <cfloat> #include <cmath> #include <cstdint> #include <ctime> @@ -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 // not be exactly equal due to fused multiply/add contraction.) 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 auto duration_tick = absl::time_internal::MakeDuration(0, 1u); int misses = 0; diff --git a/absl/time/internal/cctz/BUILD.bazel b/absl/time/internal/cctz/BUILD.bazel index 45a95292..35747e57 100644 --- a/absl/time/internal/cctz/BUILD.bazel +++ b/absl/time/internal/cctz/BUILD.bazel @@ -45,6 +45,7 @@ cc_library( hdrs = [ "include/cctz/civil_time.h", ], + features = ["-no_undefined"], textual_hdrs = ["include/cctz/civil_time_detail.h"], visibility = ["//visibility:public"], deps = ["//absl/base:config"], @@ -74,6 +75,7 @@ cc_library( "include/cctz/time_zone.h", "include/cctz/zone_info_source.h", ], + features = ["-no_undefined"], linkopts = select({ ":osx": [ "-framework Foundation", |