]> git.proxmox.com Git - rustc.git/blobdiff - src/compiler-rt/test/lit.common.cfg
New upstream version 1.12.0+dfsg1
[rustc.git] / src / compiler-rt / test / lit.common.cfg
index aa3fd03add5a9be8b53eb6aef6a97c4758690697..f19fde2f89eb0b4362280cb12581a55cce6bdb15 100644 (file)
@@ -72,6 +72,9 @@ config.environment['PATH'] = path
 if platform.system() == 'Windows' and '-win' in config.target_triple:
   config.environment['LIB'] = os.environ['LIB']
 
+if re.match(r'^x86_64.*-linux', config.target_triple):
+      config.available_features.add("x86_64-linux")
+
 # Use ugly construction to explicitly prohibit "clang", "clang++" etc.
 # in RUN lines.
 config.substitutions.append(
@@ -89,15 +92,17 @@ if config.host_os == 'Windows':
   # does not crash but exits with a non-zero exit code. We ought to merge
   # KillTheDoctor and not --crash to make the latter more useful and remove the
   # need for this substitution.
-  config.substitutions.append( ("%expect_crash ", "not KillTheDoctor ") )
+  config.expect_crash = "not KillTheDoctor "
 else:
-  config.substitutions.append( ("%expect_crash ", "not --crash ") )
+  config.expect_crash = "not --crash "
+
+config.substitutions.append( ("%expect_crash ", config.expect_crash) )
 
-# Add supported compiler_rt architectures to a list of available features.
-compiler_rt_arch = getattr(config, 'compiler_rt_arch', None)
-if compiler_rt_arch:
-  for arch in compiler_rt_arch.split(";"):
-    config.available_features.add(arch + "-supported-target")
+target_arch = getattr(config, 'target_arch', None)
+if target_arch:
+  config.available_features.add(target_arch + '-target-arch')
+  if target_arch in ['x86_64', 'i386', 'i686']:
+    config.available_features.add('x86-target-arch')
 
 compiler_rt_debug = getattr(config, 'compiler_rt_debug', False)
 if not compiler_rt_debug:
@@ -107,12 +112,35 @@ sanitizer_can_use_cxxabi = getattr(config, 'sanitizer_can_use_cxxabi', True)
 if sanitizer_can_use_cxxabi:
   config.available_features.add('cxxabi')
 
-# Test lld if it is available.
 if config.has_lld:
   config.available_features.add('lld')
 
+if config.can_symbolize:
+  config.available_features.add('can-symbolize')
+
 lit.util.usePlatformSdkOnDarwin(config, lit_config)
 
+if config.host_os == 'Darwin':
+  try:
+    osx_version = subprocess.check_output(["sw_vers", "-productVersion"])
+    osx_version = tuple(int(x) for x in osx_version.split('.'))
+    if osx_version >= (10, 11):
+      config.available_features.add('osx-autointerception')
+      config.available_features.add('osx-ld64-live_support')
+    else:
+      # The ASAN initialization-bug.cc test should XFAIL on OS X systems
+      # older than El Capitan. By marking the test as being unsupported with
+      # this "feature", we can pass the test on newer OS X versions and other
+      # platforms.
+      config.available_features.add('osx-no-ld64-live_support')
+  except:
+    pass
+
+sancovcc_path = os.path.join(llvm_tools_dir, "sancov") 
+if os.path.exists(sancovcc_path):
+  config.available_features.add("has_sancovcc")
+  config.substitutions.append( ("%sancovcc ", sancovcc_path) )
+
 def is_darwin_lto_supported():
   return os.path.exists(os.path.join(config.llvm_shlib_dir, 'libLTO.dylib'))