It'd be helpful to add something that exercises the new functionality along with the functionality (not necessarily a test /for/ the functionality (since this is test functionality, and then you get in the infinite rabbit hole of testing testing) - but potentially in some libDEbugInfo unit test that uses this functionality and wouldn't be possible without it?)
Yeah, it's a tricky tradeoff - trying to isolate changes, but equally trying not to commit untested/unverified functionality.
If it's possible to/you could refactor the constants (in DWARFDebugLineTest.cpp and dwarfgen::LineTable::createBasicPrologue ) so they're symbolic/don't need to be updated when writeV5IncludeAndFileTable is made - taht'd be a good isolated "NFC" commit. But no worries if that isn't possible.
Otherwise/please roll this into the other review, so the functionality is exercised when it's committed.
The change itself mostly looks fine to me, FWIW. An alternative to folding it into the other review would be to make a change in checkDefaultPrologue to check the new property of the FileNames, just like the name is already checked. The existing tests that use this function would then validate your changes.
I haven't been particularly happy with the constants in the DwarfGenerator code, although I have yet to come up with a viable alternative (not that I've thought about it all that much).