Prologue support
[oota-llvm.git] / test / lit.cfg
index 40ee8dd7299d1e7b50ceb080007bea611391587a..50ae60f67f8c0e9e35a462563881b24c6fe3867d 100644 (file)
@@ -196,7 +196,8 @@ config.substitutions.append( ('%python', config.python_executable) )
 # OCaml substitutions.
 # Support tests for both native and bytecode builds.
 config.substitutions.append( ('%ocamlc',
-    "%s ocamlc %s" % (config.ocamlfind_executable, config.ocaml_flags)) )
+    "%s ocamlc -cclib -L%s %s" %
+        (config.ocamlfind_executable, llvm_lib_dir, config.ocaml_flags)) )
 if config.have_ocamlopt in ('1', 'TRUE'):
     config.substitutions.append( ('%ocamlopt',
         "%s ocamlopt -cclib -L%s -cclib -Wl,-rpath,%s %s" %
@@ -328,10 +329,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