[libc-commits] [libc] [libc][stdfix] Implement divifx functions in LLVM libc (PR #206115)
LLVM Continuous Integration via libc-commits
libc-commits at lists.llvm.org
Wed Jul 15 21:25:56 PDT 2026
llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `libc-riscv32-qemu-yocto-fullbuild-dbg` running on `rv32gc-qemu-system` while building `libc` at step 4 "annotate".
Full details are available at: https://lab.llvm.org/buildbot/#/builders/196/builds/21155
<details>
<summary>Here is the relevant piece of the build log for the reference</summary>
```
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[236/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.idivulr_test.__unit__.__build__.dir/idivulr_test.cpp.o
[237/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.idivur_test.__unit__.__build__.dir/idivur_test.cpp.o
[238/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.idivuk_test.__unit__.__build__.dir/idivuk_test.cpp.o
[239/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.idivulk_test.__unit__.__build__.dir/idivulk_test.cpp.o
[240/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.divilr_test.__unit__.__build__.dir/divilr_test.cpp.o
[241/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.diviur_test.__unit__.__build__.dir/diviur_test.cpp.o
[242/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.rdivi_test.__unit__.__build__.dir/rdivi_test.cpp.o
[243/3912] Linking CXX executable libc/test/src/__support/libc.test.src.__support.freelist_test.__unit__.__build__
[244/3912] Linking CXX executable libc/test/src/__support/libc.test.src.__support.freestore_test.__unit__.__build__
[245/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.divilk_test.__unit__.__build__.dir/divilk_test.cpp.o
FAILED: libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.divilk_test.__unit__.__build__.dir/divilk_test.cpp.o
/usr/local/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -D_DEBUG -I/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc -I/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc -isystem /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/include -mabi=ilp32d -march=rv32imafdc --target=riscv32-unknown-linux-gnu --sysroot=/opt/riscv/sysroot --gcc-toolchain=/opt/riscv -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -Xclang -fno-pch-timestamp -g -std=gnu++17 --target=riscv32-unknown-linux-gnu -D__LIBC_USE_BUILTIN_ISNAN -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_COPT_STRING_LENGTH_IMPL=element -DLIBC_COPT_FIND_FIRST_CHARACTER_IMPL=element -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_PLATFORM -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY -DLIBC_CONF_WCTYPE_MODE=LIBC_WCTYPE_MODE_ASCII -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -DLIBC_TEST_UNDER_EMULATOR -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ffixed-point -Wall -Wextra -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wstrict-prototypes -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wthread-safety -DLIBC_COMPILER_HAS_STDC_FENV_ACCESS -DLIBC_TEST=UNIT -MD -MT libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.divilk_test.__unit__.__build__.dir/divilk_test.cpp.o -MF libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.divilk_test.__unit__.__build__.dir/divilk_test.cpp.o.d -o libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.divilk_test.__unit__.__build__.dir/divilk_test.cpp.o -c /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/divilk_test.cpp
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/divilk_test.cpp:9:
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/DiviFxTest.h:116:38: warning: overflow in expression; result is -2'147'483'648 with type 'long' [-Winteger-overflow]
116 | EXPECT_EQ(func(1, -epsilon), -epsilon_result);
| ^~~~~~~~~~~~~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:451:55: note: expanded from macro 'EXPECT_EQ'
451 | #define EXPECT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, )
| ^~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:445:31: note: expanded from macro 'LIBC_TEST_BINOP_'
445 | RHS, #LHS, #RHS, LIBC_TEST_LOC_()), \
| ^~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:437:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
437 | if (TEST) \
| ^~~~
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/divilk_test.cpp:9:
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/DiviFxTest.h:117:38: warning: overflow in expression; result is -2'147'483'648 with type 'long' [-Winteger-overflow]
117 | EXPECT_EQ(func(-1, epsilon), -epsilon_result);
| ^~~~~~~~~~~~~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:451:55: note: expanded from macro 'EXPECT_EQ'
451 | #define EXPECT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, )
| ^~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:445:31: note: expanded from macro 'LIBC_TEST_BINOP_'
445 | RHS, #LHS, #RHS, LIBC_TEST_LOC_()), \
| ^~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:437:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
437 | if (TEST) \
| ^~~~
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/divilk_test.cpp:9:
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/DiviFxTest.h:123:25: error: constexpr variable 'largest_positive' must be initialized by a constant expression
123 | constexpr IntType largest_positive =
| ^
124 | ((static_cast<IntType>(1) << FXRep::INTEGRAL_LEN) - 1);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/divilk_test.cpp:14:1: note: in instantiation of member function 'DiviFxTest<long, long _Accum>::testEdgeCases' requested here
14 | LIST_DIVIFX_TESTS(lk, long int, long accum, LIBC_NAMESPACE::divilk);
| ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/DiviFxTest.h:168:49: note: expanded from macro 'LIST_DIVIFX_TESTS'
168 | TEST_F(LlvmLibcDivi##Name##Test, EdgeCases) { testEdgeCases(&func); } \
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[236/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.idivulr_test.__unit__.__build__.dir/idivulr_test.cpp.o
[237/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.idivur_test.__unit__.__build__.dir/idivur_test.cpp.o
[238/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.idivuk_test.__unit__.__build__.dir/idivuk_test.cpp.o
[239/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.idivulk_test.__unit__.__build__.dir/idivulk_test.cpp.o
[240/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.divilr_test.__unit__.__build__.dir/divilr_test.cpp.o
[241/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.diviur_test.__unit__.__build__.dir/diviur_test.cpp.o
[242/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.rdivi_test.__unit__.__build__.dir/rdivi_test.cpp.o
[243/3912] Linking CXX executable libc/test/src/__support/libc.test.src.__support.freelist_test.__unit__.__build__
[244/3912] Linking CXX executable libc/test/src/__support/libc.test.src.__support.freestore_test.__unit__.__build__
[245/3912] Building CXX object libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.divilk_test.__unit__.__build__.dir/divilk_test.cpp.o
FAILED: libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.divilk_test.__unit__.__build__.dir/divilk_test.cpp.o
/usr/local/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -D_DEBUG -I/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc -I/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc -isystem /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/include -mabi=ilp32d -march=rv32imafdc --target=riscv32-unknown-linux-gnu --sysroot=/opt/riscv/sysroot --gcc-toolchain=/opt/riscv -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -Xclang -fno-pch-timestamp -g -std=gnu++17 --target=riscv32-unknown-linux-gnu -D__LIBC_USE_BUILTIN_ISNAN -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_COPT_STRING_LENGTH_IMPL=element -DLIBC_COPT_FIND_FIRST_CHARACTER_IMPL=element -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_PLATFORM -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY -DLIBC_CONF_WCTYPE_MODE=LIBC_WCTYPE_MODE_ASCII -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -DLIBC_TEST_UNDER_EMULATOR -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ffixed-point -Wall -Wextra -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wstrict-prototypes -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wthread-safety -DLIBC_COMPILER_HAS_STDC_FENV_ACCESS -DLIBC_TEST=UNIT -MD -MT libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.divilk_test.__unit__.__build__.dir/divilk_test.cpp.o -MF libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.divilk_test.__unit__.__build__.dir/divilk_test.cpp.o.d -o libc/test/src/stdfix/CMakeFiles/libc.test.src.stdfix.divilk_test.__unit__.__build__.dir/divilk_test.cpp.o -c /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/divilk_test.cpp
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/divilk_test.cpp:9:
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/DiviFxTest.h:116:38: warning: overflow in expression; result is -2'147'483'648 with type 'long' [-Winteger-overflow]
116 | EXPECT_EQ(func(1, -epsilon), -epsilon_result);
| ^~~~~~~~~~~~~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:451:55: note: expanded from macro 'EXPECT_EQ'
451 | #define EXPECT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, )
| ^~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:445:31: note: expanded from macro 'LIBC_TEST_BINOP_'
445 | RHS, #LHS, #RHS, LIBC_TEST_LOC_()), \
| ^~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:437:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
437 | if (TEST) \
| ^~~~
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/divilk_test.cpp:9:
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/DiviFxTest.h:117:38: warning: overflow in expression; result is -2'147'483'648 with type 'long' [-Winteger-overflow]
117 | EXPECT_EQ(func(-1, epsilon), -epsilon_result);
| ^~~~~~~~~~~~~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:451:55: note: expanded from macro 'EXPECT_EQ'
451 | #define EXPECT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, )
| ^~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:445:31: note: expanded from macro 'LIBC_TEST_BINOP_'
445 | RHS, #LHS, #RHS, LIBC_TEST_LOC_()), \
| ^~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/UnitTest/LibcTest.h:437:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
437 | if (TEST) \
| ^~~~
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/divilk_test.cpp:9:
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/DiviFxTest.h:123:25: error: constexpr variable 'largest_positive' must be initialized by a constant expression
123 | constexpr IntType largest_positive =
| ^
124 | ((static_cast<IntType>(1) << FXRep::INTEGRAL_LEN) - 1);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/divilk_test.cpp:14:1: note: in instantiation of member function 'DiviFxTest<long, long _Accum>::testEdgeCases' requested here
14 | LIST_DIVIFX_TESTS(lk, long int, long accum, LIBC_NAMESPACE::divilk);
| ^
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdfix/DiviFxTest.h:168:49: note: expanded from macro 'LIST_DIVIFX_TESTS'
168 | TEST_F(LlvmLibcDivi##Name##Test, EdgeCases) { testEdgeCases(&func); } \
```
</details>
https://github.com/llvm/llvm-project/pull/206115
More information about the libc-commits
mailing list