I'm planning to modify this API shortly and thought best to first make it independently testable.
This adds a -compiler-context=<...> option to lldb-test that translates a JSON-formatted string that is a list of kind/name pairs and translates it into a std::vector<CompilerContext>, a CompilerContext being a pair of context-kind and name.
We generally put test data into an Inputs subfolder. Though in this case, it looks like you could actually inline the data into the test file below. (Feel free to add .ll into the list of test suffixes.)