The TestPDLByteCodePass, as its name clearly indicates, is a test pass. It is intended to test the infrastructure itself. Clients must not use it beyond writing tests or debugging. It does not restrict what clients can do with the infrastructure.
If you take even a cursory look at the implementation of said pass, you will see that the PDL pattern module can be trivially constructed from an IR module (llvm-project/TestPDLByteCode.cpp at main · llvm/llvm-project · GitHub) regardless of the provenance of the latter. It is then equally simple to just open a second file and parse a module from there.