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// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
10
11// test numeric_limits
12
13// float_denorm_style
14
15#include <limits>
16
17#include "test_macros.h"
18
19typedef char one;
20struct two {one _[2];};
21
22one test(std::float_denorm_style);
23two test(int);
24
25int main(int, char**)
26{
27 static_assert(std::denorm_indeterminate == -1,
28 "std::denorm_indeterminate == -1");
29 static_assert(std::denorm_absent == 0,
30 "std::denorm_absent == 0");
31 static_assert(std::denorm_present == 1,
32 "std::denorm_present == 1");
33 static_assert(sizeof(test(std::denorm_present)) == 1,
34 "sizeof(test(std::denorm_present)) == 1");
35 static_assert(sizeof(test(1)) == 2,
36 "sizeof(test(1)) == 2");
37
38 return 0;
39}
40

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