[dragonegg] r176081 - Detect whether GCC supports java. Don't dump .s files from the test in the

Duncan Sands baldrick at free.fr
Tue Feb 26 01:55:28 PST 2013


Author: baldrick
Date: Tue Feb 26 03:55:28 2013
New Revision: 176081

URL: http://llvm.org/viewvc/llvm-project?rev=176081&view=rev
Log:
Detect whether GCC supports java.  Don't dump .s files from the test in the
working directory, send them to /dev/null.

Added:
    dragonegg/trunk/test/e.class   (with props)
Modified:
    dragonegg/trunk/test/DEUtils.py

Modified: dragonegg/trunk/test/DEUtils.py
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/DEUtils.py?rev=176081&r1=176080&r2=176081&view=diff
==============================================================================
--- dragonegg/trunk/test/DEUtils.py (original)
+++ dragonegg/trunk/test/DEUtils.py Tue Feb 26 03:55:28 2013
@@ -1,3 +1,4 @@
+import os
 import tempfile
 import TestRunner
 
@@ -38,6 +39,18 @@ def getSuffixesForLanguage(language):
   return suffixes
 
 def isLanguageSupported(language, compiler):
+  # How to run the compiler.  Additional arguments are added below.
+  args = [compiler, '-S', '-o', '/dev/null']
+
+  if language == 'java':
+    # GCC can't compile Java source by itself, it can only compile class files.
+    script_dir = os.path.dirname(os.path.realpath(__file__))
+    source = os.path.join(script_dir, 'e.class')
+    # Java is supported if the class file compiles without error.
+    out,err,exitCode = TestRunner.executeCommand(args +
+                                                 [source, '-fuse-boehm-gc'])
+    return exitCode == 0
+
   if language == 'ada':
     suffix='.ads'
   elif language == 'c':
@@ -70,7 +83,7 @@ def isLanguageSupported(language, compil
   source.flush()
 
   # The language is supported if the file compiles without error.
-  out,err,exitCode = TestRunner.executeCommand([compiler, '-S', source.name])
+  out,err,exitCode = TestRunner.executeCommand(args + [source.name])
   return exitCode == 0
 
 def getSupportedLanguages(compiler):

Added: dragonegg/trunk/test/e.class
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/e.class?rev=176081&view=auto
==============================================================================
Binary file - no diff available.

Propchange: dragonegg/trunk/test/e.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream





More information about the llvm-commits mailing list