This checks that all combinations of optimized & non-optimized, and whole-module
optimization & incremental compilation give the same result, on a module where
this is actually interesting (i.e. has multiple files so the behaviour differs
between the two).
Actually looking at the dumped IR is usually not interesting, the tests just
need to get to that stage to be able to perform the validation
correctly. Additionally, the IR is very large for some of these tests, so
dumping it makes things sllooooowww when something fails.
Sometimes, inconsistently, an accessor appears as a member of a parent
DeclContext, but other times it can seemingly only be accessed through the
storage decl. Instead of trying to conditionalise on this, just use the storage
decl as the canonical source, and ignore direct visits to accessors (i.e. the
membership route to ones that are members of other things).
Fixes rdar://problem/40476839.
It can now:
- not validate (=none)
- validate that all symbols in the IR are also in the TBD (=missing),
- validate the above, and also that all in the TBD are in the IR (=all).
The first and last were switched between with the old boolean flag, the
second is new.
Only one of these tests actually "passes", since TBDGen is incomplete,
but the use of FileCheck means they'll be flagged to be updated as
TBDGen improves: the failures are known problems.