Skip to content

Commit

Permalink
Add tests for dynamic allocated cpp_int
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoffee committed Feb 14, 2025
1 parent 2f21d9b commit 4ac604d
Show file tree
Hide file tree
Showing 7 changed files with 565 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ exe has_eigen : has_eigen.cpp ;
exe has_f2c : has_f2c.cpp f2c ;
obj has_is_constant_evaluated : has_is_constant_evaluated.cpp ;
obj has_constexpr_limits : has_constexpr_limits_cmd.cpp : <cxxflags>-fconstexpr-ops-limit=268435456 ;
obj has_constexpr_dynamic_memory : has_constexpr_dynamic_memory.cpp : <cxxflags>-std=c++2a ;
obj has_big_obj : has_big_obj.cpp : <cxxflags>-Wa,-mbig-obj ;
obj is_ci_sanitizer_run : is_ci_sanitizer_run.cpp ;

Expand All @@ -90,6 +91,7 @@ explicit has_mpc ;
explicit has_eigen ;
explicit has_is_constant_evaluated ;
explicit has_constexpr_limits ;
explicit has_constexpr_dynamic_memory ;
explicit has_big_obj ;
explicit has_f2c ;
explicit is_ci_sanitizer_run ;
25 changes: 25 additions & 0 deletions config/has_constexpr_dynamic_memory.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright John Maddock 2025.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <memory>


#if !defined(__cpp_constexpr_dynamic_alloc)
# error "__cpp_constexpr_dynamic_alloc is not defined"

#elif __cpp_constexpr_dynamic_alloc < 201907
# error "__cpp_constexpr_dynamic_alloc is defined with value < 201907"

#elif !defined(__cpp_lib_constexpr_dynamic_alloc)
# error "__cpp_lib_constexpr_dynamic_alloc is not defined"

#elif __cpp_lib_constexpr_dynamic_alloc < 201907
# error "__cpp_lib_constexpr_dynamic_alloc is defined with value < 201907"
#endif

int main()
{
return 0;
}
5 changes: 4 additions & 1 deletion test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,8 @@ test-suite misc :
[ run constexpr_test_cpp_int_5.cpp : : : [ requires cxx14_constexpr cxx17_if_constexpr ] [ check-target-builds ../config//has_is_constant_evaluated : : <build>no ] ]
[ run constexpr_test_cpp_int_6.cpp : : : [ requires cxx14_constexpr cxx17_if_constexpr ] [ check-target-builds ../config//has_is_constant_evaluated : <toolset>msvc:<cxxflags>-constexpr:steps10000000 <toolset>clang:<cxxflags>-fconstexpr-steps=268435456 : <build>no ] [ check-target-builds ../config//has_constexpr_limits : <cxxflags>-fconstexpr-ops-limit=268435456 ] ]
[ run constexpr_test_cpp_int_7.cpp : : : [ requires cxx14_constexpr cxx17_if_constexpr ] [ check-target-builds ../config//has_is_constant_evaluated : <toolset>msvc:<cxxflags>-constexpr:steps10000000 <toolset>clang:<cxxflags>-fconstexpr-steps=268435456 : <build>no ] ]
[ run constexpr_test_dynamic_cpp_int_1.cpp : : : [ requires cxx14_constexpr cxx17_if_constexpr ] [ check-target-builds ../config//has_constexpr_dynamic_memory : <toolset>msvc:<cxxflags>-constexpr\:steps10000000 <toolset>clang:<cxxflags>-fconstexpr-steps=268435456 <cxxflags>-std=c++2a : <build>no ] ]
[ run constexpr_test_dynamic_cpp_int_2.cpp : : : [ requires cxx14_constexpr cxx17_if_constexpr ] [ check-target-builds ../config//has_constexpr_dynamic_memory : <toolset>msvc:<cxxflags>-constexpr\:steps10000000 <toolset>clang:<cxxflags>-fconstexpr-steps=268435456 <cxxflags>-std=c++2a : <build>no ] ]

[ compile test_nothrow_cpp_int.cpp ]
[ compile test_nothrow_cpp_rational.cpp ]
Expand Down Expand Up @@ -1297,7 +1299,8 @@ test-suite standalone :
[ run standalone_constexpr_test_cpp_int.cpp : : : [ requires cxx14_constexpr cxx17_if_constexpr ] [ check-target-builds ../config//has_is_constant_evaluated : : <build>no ] ]
[ compile standalone_constexpr_test_float128.cpp :
[ requires cxx14_constexpr cxx17_if_constexpr ] [ check-target-builds ../config//has_float128 : <source>quadmath : <build>no ] ]

[ run standalone_constexpr_test_dynamic_cpp_int.cpp : : : [ requires cxx14_constexpr cxx17_if_constexpr ] [ check-target-builds ../config//has_constexpr_dynamic_memory : <toolset>msvc:<cxxflags>-constexpr\:steps10000000 <toolset>clang:<cxxflags>-fconstexpr-steps=268435456 <cxxflags>-std=c++2a : <build>no ] ]

[ run standalone_test_arithmetic_complex128.cpp : : : [ check-target-builds ../config//has_float128 : <source>quadmath ] ]
[ run standalone_test_arithmetic_cpp_bin_float.cpp no_eh_support : : : <toolset>msvc:<cxxflags>-bigobj [ check-target-builds ../config//has_float128 : <source>quadmath ] ]
[ run standalone_test_arithmetic_cpp_dec_float.cpp no_eh_support : : : <toolset>msvc:<cxxflags>-bigobj [ check-target-builds ../config//has_float128 : <source>quadmath ] ]
Expand Down
Loading

0 comments on commit 4ac604d

Please sign in to comment.