Fixed test suite errors due to new clang -v output.

llvm-svn: 176546
This commit is contained in:
Greg Clayton 2013-03-06 02:34:51 +00:00
parent 21c895e3d5
commit 2a844b7ff8
2 changed files with 5 additions and 7 deletions

View File

@ -34,14 +34,16 @@ class UniqueTypesTestCase(TestBase):
def unique_types(self):
"""Test for unique types of std::vector<long> and std::vector<short>."""
if "clang" in self.getCompiler() and int(self.getCompilerVersion().split('.')[0]) < 3:
compiler = self.getCompiler()
compiler_basename = os.path.basename(compiler)
if "clang" in compiler_basename and int(self.getCompilerVersion().split('.')[0]) < 3:
self.skipTest("rdar://problem/9173060 lldb hangs while running unique-types for clang version < 3")
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# GCC 4.6.3 (but not 4.4, 4.6.5 or 4.7) encodes two locations for the 'return 0' statement in main.cpp
locs = 2 if "gcc" in self.getCompiler() and "4.6.3" in self.getCompilerVersion() else 1
locs = 2 if "gcc" in compiler_basename and "4.6.3" in self.getCompilerVersion() else 1
lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=locs, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)

View File

@ -1024,11 +1024,7 @@ class Base(unittest2.TestCase):
compiler = self.getCompiler()
version_output = system([which(compiler), "-v"])[1]
for line in version_output.split(os.linesep):
compiler_shortname = 'invalid'
for c in ["clang", "LLVM", "gcc"]:
if c in compiler:
compiler_shortname = c
m = re.search('%s version ([0-9\.]+)' % compiler_shortname, line)
m = re.search('version ([0-9\.]+)', line)
if m:
version = m.group(1)
return version