This is an archive of the discontinued LLVM Phabricator instance.

[PS4] Fix the unit test to be compatible with clang driver. NFC
ClosedPublic

Authored by sgundapa on Dec 16 2015, 9:34 AM.

Details

Summary

".exe" extension is inherently checked by llvm::fs::can_execute()
This patch fixes the linker extension in clang driver and updates the
unit test to accommodate the the check string on windows.

Diff Detail

Event Timeline

sgundapa updated this revision to Diff 43019.Dec 16 2015, 9:34 AM
sgundapa retitled this revision from to [PS4] Fix the unit test to be compatible with clang driver. NFC.
sgundapa updated this object.
sgundapa added reviewers: eugenis, filcab.
sgundapa added a subscriber: cfe-commits.

So, mainly you want calls to GetProgramPath not to provide the .exe extension, even on Windows?

test/Driver/sanitizer-ld.c
382

This doesn't look right. If I try this patch on my Windows, without ps4-ld.gold.exe on my PATH, the linker command comes out as "ps4-ld.gold" which does match this regex, but for the wrong reason.
I think you want "{{.*}}ld{{(.gold)?(.exe)?}}" here.

GetProgramPath will take care of the extension.
I will change the line to "{{.*}}ld{{(.gold)?(.exe)?}}" as per your suggestion and push a new patch

sgundapa updated this revision to Diff 43038.Dec 16 2015, 11:03 AM
probinson accepted this revision.Dec 16 2015, 11:34 AM
probinson added a reviewer: probinson.

LGTM

This revision is now accepted and ready to land.Dec 16 2015, 11:34 AM
This revision was automatically updated to reflect the committed changes.