Add compiler flag test support to LIT. Fix new/delete tests on apple-clang.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@237700 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2015-05-19 15:15:53 +00:00
parent 5dce73dd6e
commit a985b8cc79
4 changed files with 28 additions and 11 deletions

View File

@@ -137,3 +137,13 @@ class CXXCompiler(object):
def getTriple(self):
cmd = [self.path] + self.flags + ['-dumpmachine']
return lit.util.capture(cmd).strip()
def hasCompileFlag(self, flag):
flags = [flag]
# Add -Werror to ensure that an unrecognized flag causes a non-zero
# exit code. -Werror is supported on all known compiler types.
if self.type is not None:
flags += ['-Werror']
cmd, out, err, rc = self.compile(os.devnull, out=os.devnull,
flags=flags)
return rc == 0