aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-01-05 23:34:09 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-01-05 23:34:09 +0000
commit150ed442417de2f87b0cd6ef8ed7c63b628e82db (patch)
tree6883e63ea58a5eb7229cebf4974caace1978cb6c
parenta1414818b9f9810a3b45f1f55d9c00f5116ec7d9 (diff)
parent26e9fda3a070ca79e4198fe0302f8248b87b5f54 (diff)
downloadgoogle-breakpad-emu-31-release.tar.gz
Snap for 8046941 from 26e9fda3a070ca79e4198fe0302f8248b87b5f54 to emu-31-releaseemu-31-release
Change-Id: Idacaa64aaaeee4ab3017665dc69198e5f90def72
-rw-r--r--src/client/windows/unittests/exception_handler_death_test.cc6
-rw-r--r--src/client/windows/unittests/exception_handler_nesting_test.cc3
2 files changed, 6 insertions, 3 deletions
diff --git a/src/client/windows/unittests/exception_handler_death_test.cc b/src/client/windows/unittests/exception_handler_death_test.cc
index 5ef9e64d..79c98fdb 100644
--- a/src/client/windows/unittests/exception_handler_death_test.cc
+++ b/src/client/windows/unittests/exception_handler_death_test.cc
@@ -117,7 +117,7 @@ bool MinidumpWrittenCallback(const wchar_t* dump_path,
return succeeded;
}
-TEST_F(ExceptionHandlerDeathTest, InProcTest) {
+TEST_F(ExceptionHandlerDeathTest, InProcTest) __attribute__((optnone)) {
// For the in-proc test, we just need to instantiate an exception
// handler in in-proc mode, and crash. Since the entire test is
// reexecuted in the child process, we don't have to worry about
@@ -135,6 +135,7 @@ TEST_F(ExceptionHandlerDeathTest, InProcTest) {
// Disable GTest SEH handler
testing::DisableExceptionHandlerInScope disable_exception_handler;
+ // Do not optmize out this!
int *i = NULL;
ASSERT_DEATH((*i)++, kSuccessIndicator);
}
@@ -148,7 +149,7 @@ void clientDumpCallback(void *dump_context,
}
void ExceptionHandlerDeathTest::DoCrashAccessViolation(
- const OutOfProcGuarantee out_of_proc_guarantee) {
+ const OutOfProcGuarantee out_of_proc_guarantee) __attribute__((optnone)) {
scoped_ptr<google_breakpad::ExceptionHandler> exc;
if (out_of_proc_guarantee == OUT_OF_PROC_GUARANTEED) {
@@ -184,6 +185,7 @@ void ExceptionHandlerDeathTest::DoCrashAccessViolation(
// if it's not true we'll still get an error rather than the crash
// being expected.
ASSERT_TRUE(exc->IsOutOfProcess());
+ // Do not optimize out this!
int *i = NULL;
printf("%d\n", (*i)++);
}
diff --git a/src/client/windows/unittests/exception_handler_nesting_test.cc b/src/client/windows/unittests/exception_handler_nesting_test.cc
index 3ae1d7cd..3caf3a1a 100644
--- a/src/client/windows/unittests/exception_handler_nesting_test.cc
+++ b/src/client/windows/unittests/exception_handler_nesting_test.cc
@@ -128,11 +128,12 @@ bool MinidumpWrittenCallback(const wchar_t* dump_path,
}
-void DoCrash(const char *message) {
+void DoCrash(const char *message) __attribute__((optnone)) {
if (message) {
fprintf(stderr, "%s", message);
fflush(stderr);
}
+ // Do not optimize out this!
int *i = NULL;
(*i)++;