Report an error when -m<os>-version-min= does not specify a version.

Currently if you use -mmacosx-version-min or -mios-version-min without
specifying a version number, clang silently sets the minimum version to
"0.0.0". This is almost certainly not what was intended, so it is better
to report it as an error. rdar://problem/20433945

llvm-svn: 234270
This commit is contained in:
Bob Wilson 2015-04-07 01:03:35 +00:00
parent 9918155779
commit 433cb315d3
2 changed files with 4 additions and 1 deletions

View File

@ -2152,7 +2152,7 @@ bool Driver::GetReleaseVersion(const char *Str, unsigned &Major,
Major = Minor = Micro = 0;
if (*Str == '\0')
return true;
return false;
char *End;
Major = (unsigned) strtol(Str, &End, 10);

View File

@ -30,6 +30,9 @@
// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.10 -c %s -### 2>&1 | \
// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX10 %s
// CHECK-VERSION-OSX10: "x86_64-apple-macosx10.10.0"
// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min= -c %s -### 2>&1 | \
// RUN: FileCheck --check-prefix=CHECK-VERSION-MISSING %s
// CHECK-VERSION-MISSING: invalid version number
// Check environment variable gets interpreted correctly
// RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 \