Unverified Commit fe300f35 authored by Konstantin Varlamov's avatar Konstantin Varlamov Committed by GitHub
Browse files

[libc++][hardening] Add tests for the hardened mode with ABI breaks. (#71020)

Add a new test mode that enables the hardened mode in combination with
ABI-breaking changes (only bounded iterators currently) and reenable the
bounded iterator tests for `span` and `string_view`.
parent ab6bd943
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
set(LIBCXX_HARDENING_MODE "hardened" CACHE STRING "")
set(LIBCXX_ABI_DEFINES "_LIBCPP_ABI_BOUNDED_ITERATORS" CACHE STRING "")
+2 −2
Original line number Diff line number Diff line
@@ -9,8 +9,8 @@

// Make sure that std::span's iterators check for OOB accesses when the debug mode is enabled.

// REQUIRES: has-unix-headers
// UNSUPPORTED: !libcpp-has-legacy-debug-mode
// REQUIRES: has-unix-headers, libcpp-has-abi-bounded-iterators
// UNSUPPORTED: libcpp-hardening-mode=unchecked

#include <span>

+2 −2
Original line number Diff line number Diff line
@@ -8,8 +8,8 @@

// Make sure that std::string_view's iterators check for OOB accesses when the debug mode is enabled.

// REQUIRES: has-unix-headers
// UNSUPPORTED: !libcpp-has-legacy-debug-mode
// REQUIRES: has-unix-headers, libcpp-has-abi-bounded-iterators
// UNSUPPORTED: libcpp-hardening-mode=unchecked

#include <string_view>

+18 −0
Original line number Diff line number Diff line
@@ -422,6 +422,24 @@ steps:
          limit: 2
    timeout_in_minutes: 120

  - label: "Hardened mode with ABI breaks"
    command: "libcxx/utils/ci/run-buildbot generic-hardened-mode-with-abi-breaks"
    artifact_paths:
      - "**/test-results.xml"
      - "**/*.abilist"
    env:
        CC: "clang-${LLVM_HEAD_VERSION}"
        CXX: "clang++-${LLVM_HEAD_VERSION}"
        ENABLE_CLANG_TIDY: "On"
    agents:
      queue: "libcxx-builders"
      os: "linux"
    retry:
      automatic:
        - exit_status: -1  # Agent was lost
          limit: 2
    timeout_in_minutes: 120

  - label: "Safe mode"
    command: "libcxx/utils/ci/run-buildbot generic-safe-mode"
    artifact_paths:
+6 −0
Original line number Diff line number Diff line
@@ -401,6 +401,12 @@ generic-hardened-mode)
    check-runtimes
    check-abi-list
;;
generic-hardened-mode-with-abi-breaks)
    clean
    generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardened-mode-with-abi-breaks.cmake"
    check-runtimes
    check-abi-list
;;
generic-safe-mode)
    clean
    generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-safe-mode.cmake"
Loading