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:
@@ -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
|
||||
|
Reference in New Issue
Block a user