[libc-commits] [PATCH] D149705: [libc] Enable the 'stdlib' unit tests to be hermetic

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed May 3 00:52:18 PDT 2023


sivachandra added inline comments.


================
Comment at: libc/test/UnitTest/RoundingModeUtils.cpp:40
   if (old_rounding_mode != rounding_mode)
-    fesetround(rounding_mode);
+    fputil::set_round(rounding_mode);
 }
----------------
This will be break when LLVM's libc is being used in the overlay mode and fenv comes from the system libc. I don't have a better suggestion though.


================
Comment at: libc/test/src/CMakeLists.txt:29
 
+function(add_fp_test name)
+  cmake_parse_arguments(
----------------
Instead of creating another fp testing function, WDYT of https://reviews.llvm.org/D149728


================
Comment at: libc/test/src/stdlib/CMakeLists.txt:111-112
     libc.src.stdlib.strtold
+  COMPILE_FLAGS
+    -fno-builtin
 )
----------------
jhuber6 wrote:
> michaelrj wrote:
> > why is this added?
> Discussed with Siva in the discord, but otherwise it will emit a call to a `compiler-rt` function for `__floatuntixf`.
ISTM that you did not apply https://reviews.llvm.org/D149683 when you were testing? I have landed it now, can you try again? I am not able to repro this problem after I have landed https://reviews.llvm.org/D149683.


================
Comment at: libc/test/src/stdlib/CMakeLists.txt:264
+    # The EXPECT_EXITS test is only availible for unit tests.
+    UNIT_TEST_ONLY
   )
----------------
Nit: Move this right under the name so that it catches the reader's eye.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149705/new/

https://reviews.llvm.org/D149705



More information about the libc-commits mailing list