[llvm-commits] [zorg] r105979 - /zorg/trunk/lnt/lnt/tests/nt.py

Daniel Dunbar daniel at zuster.org
Mon Jun 14 17:16:39 PDT 2010


Author: ddunbar
Date: Mon Jun 14 19:16:39 2010
New Revision: 105979

URL: http://llvm.org/viewvc/llvm-project?rev=105979&view=rev
Log:
LNT/nt: Always pass the cxx_under_test to the LLVM test makefiles, since it may
be used to link even when we aren't testing C++ code.

Also, fall back to the cc_under_test if the cxx_under_test doesn't exist, to
support testing old Clang revisions before clang++ materialized.

Modified:
    zorg/trunk/lnt/lnt/tests/nt.py

Modified: zorg/trunk/lnt/lnt/tests/nt.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/tests/nt.py?rev=105979&r1=105978&r2=105979&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/tests/nt.py (original)
+++ zorg/trunk/lnt/lnt/tests/nt.py Mon Jun 14 19:16:39 2010
@@ -45,7 +45,9 @@
     # Set the make variables to use.
     make_variables = {
         'TARGET_CC' : opts.cc_reference,
+        'TARGET_CXX' : opts.cxx_reference,
         'TARGET_LLVMGCC' : opts.cc_under_test,
+        'TARGET_LLVMGXX' : opts.cxx_under_test,
         'TARGET_FLAGS' : ' '.join(target_flags),
         'TARGET_LLCFLAGS' : ' '.join(target_llcflags),
         'ENABLE_OPTIMIZED' : '1',
@@ -61,11 +63,7 @@
         make_variables['LLC_OPTFLAGS'] = opts.optimize_option
 
     # Set test selection variables.
-    make_variables['TARGET_CXX'] = opts.cxx_reference
-    if opts.test_cxx:
-        make_variables['TARGET_LLVMGXX'] = opts.cxx_under_test
-    else:
-        make_variables['TARGET_LLVMGXX'] = 'false'
+    if not opts.test_cxx:
         make_variables['DISABLE_CXX'] = '1'
     if not opts.test_cbe:
         make_variables['DISABLE_CBE'] = '1'
@@ -639,6 +637,18 @@
         if opts.test_cxx and opts.cxx_under_test is None:
             parser.error('--cxx is required')
 
+        # Always set cxx_under_test, since it may be used as the linker even
+        # when not testing C++ code.
+        if opts.cxx_under_test is None:
+            opts.cxx_under_test = opts.cc_under_test
+
+        # FIXME: As a hack to allow sampling old Clang revisions, if we are
+        # given a C++ compiler that doesn't exist, reset it to just use the
+        # given C compiler.
+        if not os.path.exists(opts.cxx_under_test):
+            warning("invalid cxx_under_test, falling back to cc_under_test")
+            opts.cxx_under_test = opts.cc_under_test
+
         if opts.llvm_src_root is None:
             parser.error('--llvm-src is required')
         if opts.llvm_obj_root is None:





More information about the llvm-commits mailing list