I'm have a
[PATCH] isDereferenceablePointer: look through gc.relocates
and I want to know how to test this patch. So far, I've found one
candiate: speculative execution in SimplifyCFG
(test/Transforms/SimplifyCFG/SpeculativeExec.ll). However, it's
somewhat involved to show that SimplifyCFG does kick in for
gc.relocate. Is there a better way to directly test it?
There is. See the 'unittests/' directory which contains the C++ unit tests. See unittests/IR/UserTest.cpp for an example that builds up IR from a .ll-in-a-C-string then queries C++ API operations on it.
There is. See the 'unittests/' directory which contains the C++ unit tests. See unittests/IR/UserTest.cpp for an example that builds up IR from a .ll-in-a-C-string then queries C++ API operations on it.
Thanks for pointing that out. Another option might be to introduce a small printing pass that simply prints the dereferenceability of every pointer in a function - analogous to MemDepPrinter - then use FileCheck on the result of that.
Another option might be to introduce a small printing pass that simply
prints the dereferenceability of every pointer in a function - analogous to
MemDepPrinter - then use FileCheck on the result of that.
Another option might be to introduce a small printing pass that simply
prints the dereferenceability of every pointer in a function - analogous to
MemDepPrinter - then use FileCheck on the result of that.
Perfect. I'll do that.
Done. I hope this approach doesn't lead to an explosion of little printers.