Skip to content

Commit

Permalink
Document test is for libc++ hardening
Browse files Browse the repository at this point in the history
Change-Id: I8cc3c8a622d9807ca477184683b29900ca420267
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4889668
Auto-Submit: danakj <danakj@chromium.org>
Reviewed-by: Elly FJ <ellyjones@chromium.org>
Commit-Queue: Elly FJ <ellyjones@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1201685}
  • Loading branch information
danakj authored and Chromium LUCI CQ committed Sep 26, 2023
1 parent 9120230 commit 08de6c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions base/std_clamp_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ struct AnotherType {
int some_other_int;
};

// Verify libc++ hardening terminates instead of UB with invalid clamp args.
TEST(ClampTest, Death) {
EXPECT_DEATH_IF_SUPPORTED(std::ignore = std::clamp(3, 10, 0), "");
EXPECT_DEATH_IF_SUPPORTED(std::ignore = std::clamp(3.0, 10.0, 0.0), "");
Expand Down

0 comments on commit 08de6c7

Please sign in to comment.