Merge pull request #1523 from leissa/int3

provide alternative for DebugBreak()
This commit is contained in:
Gennadiy Civil 2018-04-04 10:51:46 -04:00 committed by GitHub
commit 07af8af373
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4549,6 +4549,9 @@ void UnitTest::AddTestPartResult(
// when a failure happens and both the --gtest_break_on_failure and
// the --gtest_catch_exceptions flags are specified.
DebugBreak();
#elif (defined(__clang__) || defined(__GNUC__)) && (defined(__x86_64__) || defined(__i386__))
// with clang/gcc we can achieve the same effect on x86 by invoking int3
asm("int3");
#else
// Dereference NULL through a volatile pointer to prevent the compiler
// from removing. We use this rather than abort() or __builtin_trap() for