Skip to content

Commit e7d6eca

Browse files
committed
Add a new CI job to test the observe semantic
1 parent 3d6b813 commit e7d6eca

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ jobs:
128128
'generic-abi-unstable',
129129
'generic-hardening-mode-debug',
130130
'generic-hardening-mode-extensive',
131+
'generic-hardening-mode-extensive-observe-semantic',
131132
'generic-hardening-mode-fast',
132133
'generic-hardening-mode-fast-with-abi-breaks',
133134
'generic-merged',
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
set(LIBCXX_HARDENING_MODE "extensive" CACHE STRING "")
2+
set(LIBCXX_TEST_PARAMS "assertion_semantic=observe" CACHE STRING "")

libcxx/utils/ci/run-buildbot

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,12 @@ generic-hardening-mode-extensive)
442442
check-runtimes
443443
check-abi-list
444444
;;
445+
generic-hardening-mode-extensive-observe-semantic)
446+
clean
447+
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-extensive-observe-semantic.cmake"
448+
check-runtimes
449+
check-abi-list
450+
;;
445451
generic-hardening-mode-debug)
446452
clean
447453
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-debug.cmake"

libcxx/utils/libcxx/test/params.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,5 +454,24 @@ def getSuitableClangTidy(cfg):
454454
help="Whether to test the main or C++03-specific headers. Only changes behaviour when std=c++03.",
455455
actions=lambda enabled: [] if not enabled else [AddFlag("-D_LIBCPP_USE_FROZEN_CXX03_HEADERS"), AddFeature("FROZEN-CXX03-HEADERS-FIXME")],
456456
),
457+
Parameter(
458+
name='assertion_semantic',
459+
choices=["ignore", "observe", "quick_enforce", "enforce", "undefined"],
460+
type=str,
461+
default="undefined",
462+
help="Whether to override the assertion semantic used by hardening. This is only meaningful when running the "
463+
"tests against libc++ with hardening enabled. By default, no assertion semantic is specified explicitly, so "
464+
"the default one will be used (depending on the hardening mode).",
465+
actions=lambda assertion_semantic: filter(
466+
None,
467+
[
468+
AddCompileFlag("-D_LIBCPP_ASSERTION_SEMANTIC=_LIBCPP_ASSERTION_SEMANTIC_IGNORE") if assertion_semantic == "ignore" else None,
469+
AddCompileFlag("-D_LIBCPP_ASSERTION_SEMANTIC=_LIBCPP_ASSERTION_SEMANTIC_OBSERVE") if assertion_semantic == "observe" else None,
470+
AddCompileFlag("-D_LIBCPP_ASSERTION_SEMANTIC=_LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE") if assertion_semantic == "quick_enforce" else None,
471+
AddCompileFlag("-D_LIBCPP_ASSERTION_SEMANTIC=_LIBCPP_ASSERTION_SEMANTIC_ENFORCE") if assertion_semantic == "enforce" else None,
472+
AddFeature("libcpp-assertion-semantic={}".format(assertion_semantic)) if assertion_semantic != "undefined" else None,
473+
],
474+
),
475+
),
457476
]
458477
# fmt: on

0 commit comments

Comments
 (0)