[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / depr / depr.c.headers / fenv_h.pass.cpp
blob5a1633a2936a0f8b2689a3c5953f3152e87f37eb
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 // XFAIL: newlib
11 // <fenv.h>
13 #include <fenv.h>
14 #include <type_traits>
16 #include "test_macros.h"
18 #ifndef FE_DIVBYZERO
19 #error FE_DIVBYZERO not defined
20 #endif
22 #ifndef FE_INEXACT
23 #error FE_INEXACT not defined
24 #endif
26 #ifndef FE_INVALID
27 #error FE_INVALID not defined
28 #endif
30 #ifndef FE_OVERFLOW
31 #error FE_OVERFLOW not defined
32 #endif
34 #ifndef FE_UNDERFLOW
35 #error FE_UNDERFLOW not defined
36 #endif
38 #ifndef FE_ALL_EXCEPT
39 #error FE_ALL_EXCEPT not defined
40 #endif
42 #ifndef FE_DOWNWARD
43 #error FE_DOWNWARD not defined
44 #endif
46 #ifndef FE_TONEAREST
47 #error FE_TONEAREST not defined
48 #endif
50 #ifndef FE_TOWARDZERO
51 #error FE_TOWARDZERO not defined
52 #endif
54 #ifndef FE_UPWARD
55 #error FE_UPWARD not defined
56 #endif
58 #ifndef FE_DFL_ENV
59 #error FE_DFL_ENV not defined
60 #endif
62 int main(int, char**)
64 fenv_t fenv = {};
65 fexcept_t fex = 0;
66 static_assert((std::is_same<decltype(::feclearexcept(0)), int>::value), "");
67 static_assert((std::is_same<decltype(::fegetexceptflag(&fex, 0)), int>::value), "");
68 static_assert((std::is_same<decltype(::feraiseexcept(0)), int>::value), "");
69 static_assert((std::is_same<decltype(::fesetexceptflag(&fex, 0)), int>::value), "");
70 static_assert((std::is_same<decltype(::fetestexcept(0)), int>::value), "");
71 static_assert((std::is_same<decltype(::fegetround()), int>::value), "");
72 static_assert((std::is_same<decltype(::fesetround(0)), int>::value), "");
73 static_assert((std::is_same<decltype(::fegetenv(&fenv)), int>::value), "");
74 static_assert((std::is_same<decltype(::feholdexcept(&fenv)), int>::value), "");
75 static_assert((std::is_same<decltype(::fesetenv(&fenv)), int>::value), "");
76 static_assert((std::is_same<decltype(::feupdateenv(&fenv)), int>::value), "");
78 return 0;