[PATCH] D122740: [demangler] Node precision dumper

Nathan Sidwell via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 12:15:07 PDT 2022


urnathan added a comment.

In D122740#3433877 <https://reviews.llvm.org/D122740#3433877>, @dblaikie wrote:

> In D122740#3430230 <https://reviews.llvm.org/D122740#3430230>, @urnathan wrote:
>
>> In D122740#3424667 <https://reviews.llvm.org/D122740#3424667>, @dblaikie wrote:
>>
>>> can/should this have test coverage?
>>
>> Doesn't look simple.  This is inside NDEBUG and explicitly writes to stderr, so I'm not sure how to capture that?
>
> Ah, I actually just was glancing at a commit that tested a situation like this ( rG9a62d9db2e1f6064e6c20344870f5e9d43a8de43 <https://reviews.llvm.org/rG9a62d9db2e1f6064e6c20344870f5e9d43a8de43> ) - so it can be/is done by `REQUIRES: asserts` on a lit test and then checking stderr (possibly/usually by `2>&1` to just collapse stderr and stdout together).
>
> I'd expect/hope there is already other test coverage for this general feature that you could extend - or is this whole printing system  untested?

I cannot see existing tests for this.  AFAICT the node dumping machinery is accessible via debugging llvm.  So I don't really see how a unittest could test it, nor how one could invoke the compiler to get at it.

The only 3 dump member tests I can find in llvm/unittest/...

IR/DominatorTreeBatchUpdatesTest.cpp:
Target/AMDGPU/ExecMayBeModifiedBeforeAnyUse.cpp: 
Transforms/Vectorize/VPlanTest.cpp:

but they only seem to be checking the dumpers don't crash.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122740/new/

https://reviews.llvm.org/D122740



More information about the llvm-commits mailing list