1//===----------------------------------------------------------------------===//
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-exception
6//
7//===----------------------------------------------------------------------===//
8
9// test numeric_limits
10
11// float_round_style
12
13#include <limits>
14
15#include "test_macros.h"
16
17typedef char one;
18struct two {one _[2];};
19
20one test(std::float_round_style);
21two test(int);
22
23int main(int, char**)
24{
25 static_assert(std::round_indeterminate == -1,
26 "std::round_indeterminate == -1");
27 static_assert(std::round_toward_zero == 0,
28 "std::round_toward_zero == 0");
29 static_assert(std::round_to_nearest == 1,
30 "std::round_to_nearest == 1");
31 static_assert(std::round_toward_infinity == 2,
32 "std::round_toward_infinity == 2");
33 static_assert(std::round_toward_neg_infinity == 3,
34 "std::round_toward_neg_infinity == 3");
35 static_assert(sizeof(test(std::round_to_nearest)) == 1,
36 "sizeof(test(std::round_to_nearest)) == 1");
37 static_assert(sizeof(test(1)) == 2,
38 "sizeof(test(1)) == 2");
39
40 return 0;
41}
42

source code of libcxx/test/std/language.support/support.limits/limits/denorm.style/check_values.pass.cpp