[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / libc / test / src / fenv / feupdateenv_test.cpp
blob1b3884a7337fe7dcc935d1e54d3073a725aa7c4b
1 //===-- Unittests for feupdateenv -----------------------------------------===//
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 //===----------------------------------------------------------------------===//
9 #include "src/fenv/feupdateenv.h"
11 #include "src/__support/FPUtil/FEnvImpl.h"
12 #include "test/UnitTest/Test.h"
14 #include <fenv.h>
15 #include <signal.h>
17 TEST(LlvmLibcFEnvTest, UpdateEnvTest) {
18 __llvm_libc::fputil::disable_except(FE_ALL_EXCEPT);
19 __llvm_libc::fputil::clear_except(FE_ALL_EXCEPT);
21 fenv_t env;
22 ASSERT_EQ(__llvm_libc::fputil::get_env(&env), 0);
23 __llvm_libc::fputil::set_except(FE_INVALID | FE_INEXACT);
24 ASSERT_EQ(__llvm_libc::feupdateenv(&env), 0);
25 ASSERT_EQ(__llvm_libc::fputil::test_except(FE_INVALID | FE_INEXACT),
26 FE_INVALID | FE_INEXACT);