Disable ccache usage for .fail.cpp tests. It causes bugs.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273390 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-06-22 07:09:59 +00:00
parent f5b30213b6
commit 420dea528a
2 changed files with 19 additions and 10 deletions

View File

@@ -47,9 +47,10 @@ class CXXCompiler(object):
self.type = compiler_type self.type = compiler_type
self.version = (major_ver, minor_ver, patchlevel) self.version = (major_ver, minor_ver, patchlevel)
def _basicCmd(self, source_files, out, is_link=False, input_is_cxx=False): def _basicCmd(self, source_files, out, is_link=False, input_is_cxx=False,
disable_ccache=False):
cmd = [] cmd = []
if self.use_ccache and not is_link: if self.use_ccache and not disable_ccache and not is_link:
cmd += ['ccache'] cmd += ['ccache']
cmd += [self.path] cmd += [self.path]
if out is not None: if out is not None:
@@ -65,12 +66,15 @@ class CXXCompiler(object):
return cmd return cmd
def preprocessCmd(self, source_files, out=None, flags=[]): def preprocessCmd(self, source_files, out=None, flags=[]):
cmd = self._basicCmd(source_files, out, input_is_cxx=True) + ['-E'] cmd = self._basicCmd(source_files, out, input_is_cxx=True,
disable_ccache=True) + ['-E']
cmd += self.flags + self.compile_flags + flags cmd += self.flags + self.compile_flags + flags
return cmd return cmd
def compileCmd(self, source_files, out=None, flags=[]): def compileCmd(self, source_files, out=None, flags=[],
cmd = self._basicCmd(source_files, out, input_is_cxx=True) + ['-c'] disable_ccache=False):
cmd = self._basicCmd(source_files, out, input_is_cxx=True,
disable_ccache=disable_ccache) + ['-c']
cmd += self.flags + self.compile_flags + flags cmd += self.flags + self.compile_flags + flags
return cmd return cmd
@@ -89,8 +93,10 @@ class CXXCompiler(object):
out, err, rc = lit.util.executeCommand(cmd, env=env, cwd=cwd) out, err, rc = lit.util.executeCommand(cmd, env=env, cwd=cwd)
return cmd, out, err, rc return cmd, out, err, rc
def compile(self, source_files, out=None, flags=[], env=None, cwd=None): def compile(self, source_files, out=None, flags=[], env=None, cwd=None,
cmd = self.compileCmd(source_files, out, flags) disable_ccache=False):
cmd = self.compileCmd(source_files, out, flags,
disable_ccache=disable_ccache)
out, err, rc = lit.util.executeCommand(cmd, env=env, cwd=cwd) out, err, rc = lit.util.executeCommand(cmd, env=env, cwd=cwd)
return cmd, out, err, rc return cmd, out, err, rc
@@ -106,7 +112,8 @@ class CXXCompiler(object):
return cmd, out, err, rc return cmd, out, err, rc
def compileLinkTwoSteps(self, source_file, out=None, object_file=None, def compileLinkTwoSteps(self, source_file, out=None, object_file=None,
flags=[], env=None, cwd=None): flags=[], env=None, cwd=None,
disable_ccache=False):
if not isinstance(source_file, str): if not isinstance(source_file, str):
raise TypeError('This function only accepts a single input file') raise TypeError('This function only accepts a single input file')
if object_file is None: if object_file is None:
@@ -117,7 +124,8 @@ class CXXCompiler(object):
with_fn = lambda: libcxx.util.nullContext(object_file) with_fn = lambda: libcxx.util.nullContext(object_file)
with with_fn() as object_file: with with_fn() as object_file:
cc_cmd, cc_stdout, cc_stderr, rc = self.compile( cc_cmd, cc_stdout, cc_stderr, rc = self.compile(
source_file, object_file, flags=flags, env=env, cwd=cwd) source_file, object_file, flags=flags, env=env, cwd=cwd,
disable_ccache=disable_ccache)
if rc != 0: if rc != 0:
return cc_cmd, cc_stdout, cc_stderr, rc return cc_cmd, cc_stdout, cc_stderr, rc

View File

@@ -172,7 +172,8 @@ class LibcxxTestFormat(object):
extra_flags += ['-Xclang', '-verify', extra_flags += ['-Xclang', '-verify',
'-Xclang', '-verify-ignore-unexpected=note'] '-Xclang', '-verify-ignore-unexpected=note']
cmd, out, err, rc = self.cxx.compile(source_path, out=os.devnull, cmd, out, err, rc = self.cxx.compile(source_path, out=os.devnull,
flags=extra_flags) flags=extra_flags,
disable_ccache=True)
expected_rc = 0 if use_verify else 1 expected_rc = 0 if use_verify else 1
if rc == expected_rc: if rc == expected_rc:
return lit.Test.PASS, '' return lit.Test.PASS, ''