[LNT] r173737 - lnt.testing.util.compilers: Recognize clang's that just report as "LLVM".

Daniel Dunbar daniel at zuster.org
Mon Jan 28 16:47:47 PST 2013


Author: ddunbar
Date: Mon Jan 28 18:47:47 2013
New Revision: 173737

URL: http://llvm.org/viewvc/llvm-project?rev=173737&view=rev
Log:
lnt.testing.util.compilers: Recognize clang's that just report as "LLVM".

Modified:
    lnt/trunk/lnt/testing/util/compilers.py
    lnt/trunk/tests/SharedInputs/FakeCompilers/fakecompiler.py
    lnt/trunk/tests/testing/Compilers.py

Modified: lnt/trunk/lnt/testing/util/compilers.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/util/compilers.py?rev=173737&r1=173736&r2=173737&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/util/compilers.py (original)
+++ lnt/trunk/lnt/testing/util/compilers.py Mon Jan 28 18:47:47 2013
@@ -113,7 +113,7 @@ def get_cc_info(path, cc_flags=[]):
             cc_src_tag, = m.groups()
         else:
             error('unable to determine gcc build version: %r' % cc_build_string)
-    elif (cc_name in ('clang', 'Apple clang', 'Apple LLVM') and
+    elif (cc_name in ('clang', 'LLVM', 'Apple clang', 'Apple LLVM') and
           (cc_extra == '' or 'based on LLVM' in cc_extra or
            (cc_extra.startswith('(') and cc_extra.endswith(')')))):
         llvm_capable = True

Modified: lnt/trunk/tests/SharedInputs/FakeCompilers/fakecompiler.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/SharedInputs/FakeCompilers/fakecompiler.py?rev=173737&r1=173736&r2=173737&view=diff
==============================================================================
--- lnt/trunk/tests/SharedInputs/FakeCompilers/fakecompiler.py (original)
+++ lnt/trunk/tests/SharedInputs/FakeCompilers/fakecompiler.py Mon Jan 28 18:47:47 2013
@@ -100,8 +100,8 @@ class Clang_git_2(LLVMCompiler):
     def print_verbose_info(self):
         print >>sys.stderr, """\
 clang version 3.2\
- (/d/g/puzzle/clang.git git:/git/puzzlebox/clang.git 8ab09316f63ea99ff23b2684c454b1008b8d5f10)\
- (http://llvm.org/git/llvm.git /d/g/puzzle/llvm.git git:/git/puzzlebox/llvm.git 7c53f795961cc2d35b85d315aadb2ac135a0fdb2)
+ (/d/g/pz/clang.git git:/git/pz/clang.git 8ab09316f63ea99ff23b2684c454b1008b8d5f10)\
+ (http://llvm.org/git/llvm.git /d/g/pz/llvm.git git:/git/pb/llvm.git 7c53f795961cc2d35b85d315aadb2ac135a0fdb2)
 Target: x86_64-apple-darwin12.2.0
 Thread model: posix"""
         print >>sys.stderr, """\
@@ -137,6 +137,18 @@ Thread model: posix"""
  "%s" "-cc1" "-E" ... more boring stuff here ...""" % (
             g_program,)
 
+class GenericLLVMCompiler(LLVMCompiler):
+    compiler_name = "llvm-compiler"
+
+    def print_verbose_info(self):
+        print >>sys.stderr, """\
+LLVM version 3.3 (git:/git/pz/clang.git 597522d740374f093a089a2acbec5b20466b2f34) (/d/g/pz/llvm git:/git/pz/llvm.git 6e95d969734af111bb33bcec0bcc27fd803a3b76)
+Target: x86_64-apple-darwin12.3.0
+Thread model: posix"""
+        print >>sys.stderr, """\
+ "%s" "-cc1" "-E" ... more boring stuff here ...""" % (
+            g_program,)
+
 fake_compilers = dict((value.compiler_name, value)
                       for key,value in locals().items()
                       if inspect.isclass(value) and \

Modified: lnt/trunk/tests/testing/Compilers.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/testing/Compilers.py?rev=173737&r1=173736&r2=173737&view=diff
==============================================================================
--- lnt/trunk/tests/testing/Compilers.py (original)
+++ lnt/trunk/tests/testing/Compilers.py Mon Jan 28 18:47:47 2013
@@ -62,3 +62,11 @@ info = get_info("clang-no-info")
 pprint.pprint(info)
 assert info['cc_name'] == 'clang'
 assert info['cc_version_number'] == '3.2'
+
+# Check a Clang that reports as "LLVM compiler."
+info = get_info("llvm-compiler")
+assert info['cc_name'] == 'clang'
+assert info['cc_build'] == 'DEV'
+assert info['inferred_run_order'] == '%s,%s' % (
+    '597522d740374f093a089a2acbec5b20466b2f34',
+    '6e95d969734af111bb33bcec0bcc27fd803a3b76')





More information about the llvm-commits mailing list