This is an archive of the discontinued LLVM Phabricator instance.

[libc++abi] Fix test under ASAN and MSAN
ClosedPublic

Authored by smeenai on Aug 25 2016, 8:48 AM.

Details

Summary

When we're running tests under ASAN or MSAN, they're compiled with -O1,
which enables tail call elimination. This causes backtrace_test to fail:
the compiler performs tail call elimination for call3_nothrow, but it
can't for call3_throw, leading to a mismatched frame count. Disable tail
call elimination (and inlining, just to be explicit) to avoid this.

Test Plan:
Configured locally with -DLLVM_USE_SANITIZER=Address and was able to
reproduce the test failure. The test passes with this change.

Diff Detail

Event Timeline

smeenai updated this revision to Diff 69256.Aug 25 2016, 8:48 AM
smeenai retitled this revision from to [libc++abi] Fix test under ASAN and MSAN.
smeenai updated this object.
smeenai added reviewers: compnerd, EricWF, rsmith.
smeenai added a subscriber: cfe-commits.
compnerd edited edge metadata.Aug 25 2016, 10:50 AM

I think it would be better to use assert(true) to avoid the TCO from kicking in.

smeenai updated this revision to Diff 69275.Aug 25 2016, 11:34 AM
smeenai edited edge metadata.

Using attributes instead of compile flags, per compnerd's suggestion

compnerd accepted this revision.Aug 26 2016, 5:08 PM
compnerd edited edge metadata.
This revision is now accepted and ready to land.Aug 26 2016, 5:08 PM
EricWF accepted this revision.Aug 26 2016, 6:13 PM
EricWF edited edge metadata.
compnerd closed this revision.Aug 28 2016, 11:24 AM

SVN r279935