diff options
-rw-r--r-- | src/client/windows/unittests/exception_handler_death_test.cc | 6 | ||||
-rw-r--r-- | src/client/windows/unittests/exception_handler_nesting_test.cc | 3 |
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)++; |