Guard a test that fails on a Release build.
authorRui Ueyama <ruiu@google.com>
Wed, 3 Jul 2013 09:09:13 +0000 (09:09 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 3 Jul 2013 09:09:13 +0000 (09:09 +0000)
llvm-svn: 185524

lld/test/layout-error-test.objtxt
lld/test/lit.cfg

index d0ae587..aefad6c 100644 (file)
@@ -1,3 +1,4 @@
+# REQUIRES: asserts
 # RUN: lld -core --add-pass layout -mllvm -debug-only=LayoutPass %s 2>&1 \
 # RUN:   | FileCheck %s -check-prefix=CHECK
 
index 6342666..ef5510c 100644 (file)
@@ -116,3 +116,16 @@ if lit.useValgrind:
 # Shell execution
 if platform.system() not in ['Windows'] or lit.getBashPath() != '':
     config.available_features.add('shell')
+
+# llc knows whether it is compiled with -DNDEBUG.
+import subprocess
+try:
+    llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'],
+                           stdout = subprocess.PIPE)
+except OSError, why:
+    print "Could not find llc in " + llvm_tools_dir
+    exit(42)
+
+if re.search(r'with assertions', llc_cmd.stdout.read()):
+    config.available_features.add('asserts')
+llc_cmd.wait()