Looking for tests for class ARMConstantIslands

Hello, everyone!

I have made a few modifications to the ARM constant island placement and branch shortening pass

(i.e., class ARMConstantIslands) to suit the pass to my control flow checking algorithm.

For now, I would like to test the modified pass alone. However it doesn’t seem to be easy to

find a program that exercises the pass. I think I need to find some existing tests, and probably

will have to modify some tests to suit my needs.

I am new to the LLVM test infrastructure. I am aware that a LLVM release comes together with a lot

of regression tests in the test directory. But it seems to be impossible to tell which files are

relevant to the pass by looking at the file names alone. In test/CodeGen/ARM, I found a few files

baring a name containing the word “island” and “jump” (as in “jump table”):








In these files, I found little documentation.

Are these all relevant to the pass? Are there other relevant tests?

How do you test the pass?

Is there a way to find all relevant regression tests easily?

Thank you!

Ming Zhang

Hi Ming,

Are these all relevant to the pass? Are there other relevant tests?

Your best bet is probably what's called "MIR tests", which are written
directly in the lower-level MachineInstr based representation and run
only the relevant pass. This gives earlier passes less opportunity to
mess with your code and break the really tight spacing requirements
needed to trigger ARMConstantIslands.

So take a look at constant-islands-cfg.mir and
v6-jumptable-clobber.mir, especially the first which looks like it was
written after the MIR representation improved (it has many fewer extra
useless details).