This is an archive of the discontinued LLVM Phabricator instance.

[libc++abi] Fix backtrace_test.pass.cpp failure seemingly caused by inlining differences.
AbandonedPublic

Authored by EricWF on Aug 15 2016, 2:15 PM.

Details

Summary

The modified assertion fails when the test is compiled at various optimization levels.
The value of nothrow_traced and throw_traced at various optimization levels are:

  • -O0: nothrow_traced = 7, throw_traced = 7
  • -O1: nothrow_traced = 4, throw_traced = 5
  • -O2: nothrow_traced = 4, throw_traced = 4
  • -O3: nothrow_traced = 4, throw_traced = 4

I'm not sure exactly what this test is doing, so I would like somebody else to sign off on this change.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 68077.Aug 15 2016, 2:15 PM
EricWF retitled this revision from to [libc++abi] Fix backtrace_test.pass.cpp failure seemingly caused by inlining differences..
EricWF updated this object.
EricWF added reviewers: danalbert, jroelofs, mclow.lists.
EricWF added a subscriber: cfe-commits.
jroelofs edited edge metadata.Aug 15 2016, 3:32 PM

I'm not sure that's guaranteed behavior either. That being said, I don't see a more robust way to write this test.

danalbert edited edge metadata.Aug 17 2016, 1:51 PM

Maybe __attribute__((noinline)) every function instead?

EricWF abandoned this revision.Oct 14 2016, 4:21 AM

Another fix was committed.