This test includes a source that will produce basic blocks and hence sections with -fbasic-block-sections=all.
The test reorders the basic blocks to be dis-contiguous in the address space and checks if the back trace contains the right symbol.
Differential D89179
New test to check if basic block sections produces the right back traces with lldb tmsriram on Oct 9 2020, 9:32 PM. Authored by
Details This test includes a source that will produce basic blocks and hence sections with -fbasic-block-sections=all. The test reorders the basic blocks to be dis-contiguous in the address space and checks if the back trace contains the right symbol.
Diff Detail
Event TimelineComment Actions I know very little about lldb and lldb's test coverage, so hopefully some other folks can chime in (CC'd @labath and @rupprecht ). Comment Actions I think this looks reasonable. A couple of comments inline.
Comment Actions I think this is like an integration test. Not all Clang supporting -fbasic-block-sections can work. This requires a Clang built at the same commit as LLDB.. (D73497 is still sitting in my review queue but it isn't being actively worked on. It seems that basic block sections feature has changed its direction? In that case, "Planning Changes" might be a good action) Comment Actions Not sure I follow - why would this test need to be built with a version matched clang+lldb? I'd expect it needed a clang with at least the functionality being tested, as @labath was mentioning - but I don't /think/ it'd need a version locked clang.
What sort of flakiness are you considering here?
Looks like the last comment on the patch was asking for further review & hasn't been responded to since? Comment Actions Address reviewer comments:
Comment Actions I'm still trying to understand what platforms is this supposed to work on -- mainly to see if additional test annotations are needed. What's the story with non-x86 non-elf targets? Yeah, that requirement would be pretty surprising, though the way this test is implemented means that it will always run with a version locked clang. If we wanted to explicitly test different versions of the compiler (I don't think it's necessary) this would need to be written as an API test. Just note that the only existing bot configured to run this way is a mac machine, so it will not be of any immediate use anyway (I think).
Isn't --symbol-ordering-file= lld-specific? I don't see it in bfd or gold docs (the latter has --section-ordering-file though).
Comment Actions I am reading this as rewriting this as an API test would not help us much. If you see benefits with an API test, I am happy to change this or add that too. Thanks!
Yes, only LLD supports symbol-ordering-file, so I explicitly used -fuse-ld=lld. I guess that also means I need the REQUIRES: lld clause.
Comment Actions I think this is fine.
Comment Actions Address reviewer comments, add UNSUPPORTED: and test one more permutation (the exact reverse) for basic block reordering. |
So, this won't work on arm for instance? How about non-elf x86 platforms?