A previous patch (https://reviews.llvm.org/D132810) introduced a test
that fails on systems where the linker executable (ld) has a .exe
extension. This patch updates the regex in the test so that lit can
look for both ld as well as ld.exe.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
70 ms | x64 debian > Clang.Driver::mingw-cfguard.c |
Event Timeline
Ah sorry about that, I didn't realize the command includes .exe on Windows. (For the record, ld" matches both ld and ld.lld.)
clang/test/Driver/mingw-cfguard.c | ||
---|---|---|
6 | Literal dot needs to be escaped as \. in regex. |
No, iirc these quotes are checked as literal part of the matched string here; otherwise the pattern ld" would match ld.exe" too. So to match any linker name, I'd write ld{{.*}}" or maybe something like ld{{[\.a-z]*}}", modulo regex syntax.
Updated the regex to ld{{(.lld)?}}{{(.exe)?}}", so that it matches the
following sequences: ld", ld.lld", ld.exe", ld.lld.exe".
@alvinhochun @mstorsjo Let me know if you'd like to see more changes. With the new regex, the tests pass at my end as well as in the Phabricator CI.
The literal dots have not been escaped as \., but the current change works anyway and the chance of false positives here should be very low. I guess this is acceptable.
Literal dot needs to be escaped as \. in regex.