For debug purposes, users of the LTO library can configure LLVM using the lto_codegen_debug_options() function, for example to set option "-function-sections". Without this change, options passed in via lto_codegen_debug_options() are parsed but not applied during compilation.
I would like advice on how to write tests for this change.
It would be possible to create unit tests in llvm/unittests/LTO, but I can find no examples of unit tests written against code in the llvm/tools directory.
The alternative would be to write a lit system test against one of the tools. In this case the obvious candidate tool is llvm-lto. However this tool does not call lto_codegen_debug_options(), and I cannot find a way to validate the change in behaviour this change introduces.
Why not doing this directly inside parseCodeGenDebugOptions()?