From 87dd8c72893485a31c9b5a8dad717a75214390f5 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Sat, 13 Aug 2022 15:05:10 +0200 Subject: [PATCH] [libc++][CI] increases constexpr evaluation limit. This was discovered as an issue in D131317. Depends on D131835 Reviewed By: #libc, var-const, ldionne, philnik Differential Revision: https://reviews.llvm.org/D131836 --- .../utilities/charconv/charconv.to.chars/integral.pass.cpp | 3 +++ libcxx/utils/libcxx/test/features.py | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp b/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp index db52ac9..1b83307 100644 --- a/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp +++ b/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp @@ -10,6 +10,9 @@ // UNSUPPORTED: !stdlib=libc++ && c++11 // UNSUPPORTED: !stdlib=libc++ && c++14 +// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=12712420 +// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=12712420 + // // to_chars_result to_chars(char* first, char* last, Integral value, diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py index 46bbd24..829fd19 100644 --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -44,6 +44,18 @@ DEFAULT_FEATURES = [ when=lambda cfg: hasCompileFlag(cfg, '-Wuser-defined-warnings'), actions=[AddCompileFlag('-Wuser-defined-warnings')]), + # Tests to validate whether the compiler has a way to set the maximum number + # of steps during constant evaluation. Since the flag differs per compiler + # store the "valid" flag as a feature. This allows passing the proper compile + # flag to the compiler: + # // ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=12345678 + # // ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=12345678 + Feature(name='has-fconstexpr-steps', + when=lambda cfg: hasCompileFlag(cfg, '-fconstexpr-steps=1')), + + Feature(name='has-fconstexpr-ops-limit', + when=lambda cfg: hasCompileFlag(cfg, '-fconstexpr-ops-limit=1')), + Feature(name='has-fblocks', when=lambda cfg: hasCompileFlag(cfg, '-fblocks')), Feature(name='-fsized-deallocation', when=lambda cfg: hasCompileFlag(cfg, '-fsized-deallocation')), Feature(name='-faligned-allocation', when=lambda cfg: hasCompileFlag(cfg, '-faligned-allocation')), -- 2.7.4