buildbot failure: Pass ID not registered

Hi all,

A recent change that I made resulted in multiple failures where the
message was "Pass ID not registered".

The original patch is this one:

I think the root cause is the line where I add the lower-switch pass
to preISel() using its pass ID. So the following change should fix the

replace this: "addPass(&LowerSwitchID);"
with this: "addPass(createLowerSwitchPass());"

But before I try this fix, I need help with the following:

1. How do I test my fix against the reported failure? "check-all" did
not catch this on my local setup. What kind of lit test can I add to
reproduce this?
2. What is wrong with using the pass ID here? Or more generally, what
are the use-cases for these two different ways of doing the same