This is an archive of the discontinued LLVM Phabricator instance.

[GCC] Match a GCC version with a patch suffix without a third version component
ClosedPublic

Authored by mstorsjo on Apr 10 2018, 1:58 PM.

Details

Summary

Previously it would only accept a string as a GCC version if it had either two components and no suffix, or three components with an optional suffix.

Debian and ubuntu provided mingw compilers have lib/gcc/target entries like "5.3-posix" and "5.3-win32". This doesn't try to make any specific preference between them (other than lexical sorting of the suffix).

Diff Detail

Repository
rC Clang

Event Timeline

mstorsjo created this revision.Apr 10 2018, 1:58 PM
martell accepted this revision.Apr 22 2018, 2:02 PM

LGTM

This revision is now accepted and ready to land.Apr 22 2018, 2:02 PM
chandlerc requested changes to this revision.Apr 22 2018, 2:26 PM

Definitely need tests here.

But no concern w/ the idea of this.

This revision now requires changes to proceed.Apr 22 2018, 2:26 PM

Definitely need tests here.

Do you have any suggestion on where to create them and what kind? Just a normal test with a fake directory tree, or some sort of unit test for the gcc version number matching logic? (And if creating a unit test, how does that work since this class isn't in the public include directory?)

Definitely need tests here.

Do you have any suggestion on where to create them and what kind? Just a normal test with a fake directory tree, or some sort of unit test for the gcc version number matching logic? (And if creating a unit test, how does that work since this class isn't in the public include directory?)

All of this logic is tested with fake directories trees and tests in test/Driver.

Should be able to look at other commits in this space to see examples of test?

mstorsjo updated this revision to Diff 143558.Apr 23 2018, 7:36 AM
mstorsjo retitled this revision from [WIP] [GCC] Match a GCC version with a patch suffix without a third version component to [GCC] Match a GCC version with a patch suffix without a third version component.
mstorsjo edited the summary of this revision. (Show Details)

Added a driver test case with a fake directory tree, with a gcc directory with such a name.

This revision is now accepted and ready to land.Apr 23 2018, 2:12 PM
This revision was automatically updated to reflect the committed changes.