Commit dc07ae76 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[wasm][test] Fix compile error on iOS

Avoid the usage of ASSERT_DEATH_IF_SUPPORTED with a matcher, as that's
not supported if death tests are not supported (e.g. on iOS).

R=jkummerow@chromium.org

Bug: v8:11974
Change-Id: Ieb33ac8605e82fde67bfcd0e81e85ac2d18e9b27
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160341Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76822}
parent f1a5b680
...@@ -301,7 +301,10 @@ TEST_P(ParameterizedMemoryProtectionTestWithSignalHandling, TestSignalHandler) { ...@@ -301,7 +301,10 @@ TEST_P(ParameterizedMemoryProtectionTestWithSignalHandling, TestSignalHandler) {
bool expect_crash = write_in_signal_handler && code_is_protected() && bool expect_crash = write_in_signal_handler && code_is_protected() &&
(!V8_HAS_PTHREAD_JIT_WRITE_PROTECT || !open_write_scope); (!V8_HAS_PTHREAD_JIT_WRITE_PROTECT || !open_write_scope);
if (expect_crash) { if (expect_crash) {
ASSERT_DEATH_IF_SUPPORTED( // Avoid {ASSERT_DEATH_IF_SUPPORTED}, because it only accepts a regex as
// second parameter, and not a matcher as {ASSERT_DEATH}.
#if GTEST_HAS_DEATH_TEST
ASSERT_DEATH(
// The signal handler should crash, but it might "accidentally" // The signal handler should crash, but it might "accidentally"
// succeed if tier-up is running in the background and using mprotect // succeed if tier-up is running in the background and using mprotect
// to unprotect the code for the whole process. In that case we // to unprotect the code for the whole process. In that case we
...@@ -316,6 +319,7 @@ TEST_P(ParameterizedMemoryProtectionTestWithSignalHandling, TestSignalHandler) { ...@@ -316,6 +319,7 @@ TEST_P(ParameterizedMemoryProtectionTestWithSignalHandling, TestSignalHandler) {
::testing::AllOf( ::testing::AllOf(
::testing::HasSubstr("Writing to"), ::testing::HasSubstr("Writing to"),
::testing::Not(::testing::HasSubstr("Successfully wrote")))); ::testing::Not(::testing::HasSubstr("Successfully wrote"))));
#endif // GTEST_HAS_DEATH_TEST
} else { } else {
base::Optional<CodeSpaceWriteScope> write_scope; base::Optional<CodeSpaceWriteScope> write_scope;
if (open_write_scope) write_scope.emplace(native_module()); if (open_write_scope) write_scope.emplace(native_module());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment