1*4684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
2*4684ddb6SLionel Sambuc //
3*4684ddb6SLionel Sambuc // The LLVM Compiler Infrastructure
4*4684ddb6SLionel Sambuc //
5*4684ddb6SLionel Sambuc // This file is dual licensed under the MIT and the University of Illinois Open
6*4684ddb6SLionel Sambuc // Source Licenses. See LICENSE.TXT for details.
7*4684ddb6SLionel Sambuc //
8*4684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
9*4684ddb6SLionel Sambuc
10*4684ddb6SLionel Sambuc // <cfenv>
11*4684ddb6SLionel Sambuc
12*4684ddb6SLionel Sambuc #include <cfenv>
13*4684ddb6SLionel Sambuc #include <type_traits>
14*4684ddb6SLionel Sambuc
15*4684ddb6SLionel Sambuc #ifndef FE_DIVBYZERO
16*4684ddb6SLionel Sambuc #error FE_DIVBYZERO not defined
17*4684ddb6SLionel Sambuc #endif
18*4684ddb6SLionel Sambuc
19*4684ddb6SLionel Sambuc #ifndef FE_INEXACT
20*4684ddb6SLionel Sambuc #error FE_INEXACT not defined
21*4684ddb6SLionel Sambuc #endif
22*4684ddb6SLionel Sambuc
23*4684ddb6SLionel Sambuc #ifndef FE_INVALID
24*4684ddb6SLionel Sambuc #error FE_INVALID not defined
25*4684ddb6SLionel Sambuc #endif
26*4684ddb6SLionel Sambuc
27*4684ddb6SLionel Sambuc #ifndef FE_OVERFLOW
28*4684ddb6SLionel Sambuc #error FE_OVERFLOW not defined
29*4684ddb6SLionel Sambuc #endif
30*4684ddb6SLionel Sambuc
31*4684ddb6SLionel Sambuc #ifndef FE_UNDERFLOW
32*4684ddb6SLionel Sambuc #error FE_UNDERFLOW not defined
33*4684ddb6SLionel Sambuc #endif
34*4684ddb6SLionel Sambuc
35*4684ddb6SLionel Sambuc #ifndef FE_ALL_EXCEPT
36*4684ddb6SLionel Sambuc #error FE_ALL_EXCEPT not defined
37*4684ddb6SLionel Sambuc #endif
38*4684ddb6SLionel Sambuc
39*4684ddb6SLionel Sambuc #ifndef FE_DOWNWARD
40*4684ddb6SLionel Sambuc #error FE_DOWNWARD not defined
41*4684ddb6SLionel Sambuc #endif
42*4684ddb6SLionel Sambuc
43*4684ddb6SLionel Sambuc #ifndef FE_TONEAREST
44*4684ddb6SLionel Sambuc #error FE_TONEAREST not defined
45*4684ddb6SLionel Sambuc #endif
46*4684ddb6SLionel Sambuc
47*4684ddb6SLionel Sambuc #ifndef FE_TOWARDZERO
48*4684ddb6SLionel Sambuc #error FE_TOWARDZERO not defined
49*4684ddb6SLionel Sambuc #endif
50*4684ddb6SLionel Sambuc
51*4684ddb6SLionel Sambuc #ifndef FE_UPWARD
52*4684ddb6SLionel Sambuc #error FE_UPWARD not defined
53*4684ddb6SLionel Sambuc #endif
54*4684ddb6SLionel Sambuc
55*4684ddb6SLionel Sambuc #ifndef FE_DFL_ENV
56*4684ddb6SLionel Sambuc #error FE_DFL_ENV not defined
57*4684ddb6SLionel Sambuc #endif
58*4684ddb6SLionel Sambuc
main()59*4684ddb6SLionel Sambuc int main()
60*4684ddb6SLionel Sambuc {
61*4684ddb6SLionel Sambuc std::fenv_t fenv = {0};
62*4684ddb6SLionel Sambuc std::fexcept_t fex = 0;
63*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::feclearexcept(0)), int>::value), "");
64*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fegetexceptflag(&fex, 0)), int>::value), "");
65*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::feraiseexcept(0)), int>::value), "");
66*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fesetexceptflag(&fex, 0)), int>::value), "");
67*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fetestexcept(0)), int>::value), "");
68*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fegetround()), int>::value), "");
69*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fesetround(0)), int>::value), "");
70*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fegetenv(&fenv)), int>::value), "");
71*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::feholdexcept(&fenv)), int>::value), "");
72*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::fesetenv(&fenv)), int>::value), "");
73*4684ddb6SLionel Sambuc static_assert((std::is_same<decltype(std::feupdateenv(&fenv)), int>::value), "");
74*4684ddb6SLionel Sambuc }
75