[PATCH] D51973: [New PM] adding unit tests for PassInstrumentation
Fedor Sergeev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 12 03:46:55 PDT 2018
fedor.sergeev added inline comments.
================
Comment at: unittests/IR/PassBuilderCallbacksTest.cpp:269-275
+ ON_CALL(*this, runBeforePass(_, _, _)).WillByDefault(Return(true));
+ EXPECT_CALL(*this, runBeforePass(_, _, Ge(0))).Times(AnyNumber());
+ EXPECT_CALL(*this, runAfterPass(_, _, Ge(1))).Times(AnyNumber());
+ EXPECT_CALL(*this, runBeforeAnalysis(_, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*this, runAfterAnalysis(_, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*this, startPassManager(_, _, _)).Times(AnyNumber());
+ EXPECT_CALL(*this, finishPassManager(_, _, _)).Times(AnyNumber());
----------------
I'm particularly worried about having to use generic EXPECT_CALLs to essentially ignore majority of PassInstrumentation calls. And then InstrumentedPasses subtests perform sequenced checking for a selected subset only.
It does not look very pretty, but it appeared to be the only way to not dive deep into the details of each and every pass manager on each test.
Repository:
rL LLVM
https://reviews.llvm.org/D51973
More information about the llvm-commits
mailing list