brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 5f23a87 Raw
39 lines · c
1//===-- RoundingModeUtils.h -------------------------------------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_LIBC_TEST_UNITTEST_ROUNDINGMODEUTILS_H10#define LLVM_LIBC_TEST_UNITTEST_ROUNDINGMODEUTILS_H11 12#include "hdr/stdint_proxy.h"13#include "src/__support/macros/config.h"14 15namespace LIBC_NAMESPACE_DECL {16namespace fputil {17namespace testing {18 19enum class RoundingMode : uint8_t { Upward, Downward, TowardZero, Nearest };20 21struct ForceRoundingMode {22  ForceRoundingMode(RoundingMode);23  ~ForceRoundingMode();24 25  int old_rounding_mode;26  int rounding_mode;27  bool success;28};29 30template <RoundingMode R> struct ForceRoundingModeTest : ForceRoundingMode {31  ForceRoundingModeTest() : ForceRoundingMode(R) {}32};33 34} // namespace testing35} // namespace fputil36} // namespace LIBC_NAMESPACE_DECL37 38#endif // LLVM_LIBC_TEST_UNITTEST_ROUNDINGMODEUTILS_H39