The PE/DLL format has a limit on 64k exported symbols per DLL; make sure to check this.
The change looks fine.
For testing, I like the idea of one function exported with 64K names. What about an object file that has just one function, and a module-definition file (.DEF file) that exports 64K aliases of it at link time? The .DEF file would be about as large as your generated .c file is now, but the object file would be tiny.
I'd have no concerns about generating the test inputs on demand--that's done quite a bit for the debugger tests--but lld is not my baby.
Added a testcase with a tiny python script that generates def files that export the same symbol a number of times. It generates two 566 KB def files, for testing the case below and above the limit. The successful link case produces a 1 MB DLL and a 8 MB import library.