[libcxx-commits] [PATCH] D131836: [libc++][CI] increases constexpr evaluation limit.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Aug 27 05:45:08 PDT 2022


Mordante updated this revision to Diff 456110.
Mordante marked 4 inline comments as done.
Mordante added a comment.

Rebased and use the new approach suggested by @ldionne.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131836

Files:
  libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp
  libcxx/utils/libcxx/test/features.py


Index: libcxx/utils/libcxx/test/features.py
===================================================================
--- libcxx/utils/libcxx/test/features.py
+++ libcxx/utils/libcxx/test/features.py
@@ -44,6 +44,18 @@
           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')),
Index: libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp
===================================================================
--- libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp
+++ 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
+
 // <charconv>
 
 // to_chars_result to_chars(char* first, char* last, Integral value,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131836.456110.patch
Type: text/x-patch
Size: 2011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220827/09d74705/attachment.bin>


More information about the libcxx-commits mailing list