v2/src/testing/runtime_source_resolution library
At runtime (in command-line VM tests) resolves and instruments Dart source.
For functional tests that instrument the compiler in ad-hoc fashion; for example to expect that given source code produces an error or other specific output.