[llvm] r221669 - Only run the gold plugin tests if gold supports the targets we test with.

Rafael Espindola rafael.espindola at gmail.com
Mon Nov 10 21:27:12 PST 2014


Author: rafael
Date: Mon Nov 10 23:27:12 2014
New Revision: 221669

URL: http://llvm.org/viewvc/llvm-project?rev=221669&view=rev
Log:
Only run the gold plugin tests if gold supports the targets we test with.

This fixes pr21345.

Modified:
    llvm/trunk/test/lit.cfg

Modified: llvm/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=221669&r1=221668&r2=221669&view=diff
==============================================================================
--- llvm/trunk/test/lit.cfg (original)
+++ llvm/trunk/test/lit.cfg Mon Nov 10 23:27:12 2014
@@ -328,10 +328,24 @@ def have_ld_plugin_support():
         return False
 
     ld_cmd = subprocess.Popen(['ld', '--help'], stdout = subprocess.PIPE)
-    if not '-plugin' in ld_cmd.stdout.read():
-        return False
+    ld_out = ld_cmd.stdout.read()
     ld_cmd.wait()
 
+    if not '-plugin' in ld_out:
+        return False
+
+    # check that the used emulations are supported.
+    emu_line = [l for l in ld_out.split('\n') if 'supported emulations' in l]
+    if len(emu_line) != 1:
+        return False
+    emu_line = emu_line[0]
+    fields = emu_line.split(':')
+    if len(fields) != 3:
+        return False
+    emulations = fields[2].split()
+    if 'elf32ppc' not in emulations or 'elf_x86_64' not in emulations:
+        return False
+
     ld_version = subprocess.Popen(['ld', '--version'], stdout = subprocess.PIPE)
     if not 'GNU gold' in ld_version.stdout.read():
         return False





More information about the llvm-commits mailing list