tests: Properly check if asserts are available

In my previous commits I failed to realise that my new requires lines fully
disabled these tests. We now properly check if we are in an asserts build and
only disable the tests if assertions are not available.

Reported-by: Sean Silva <silvas@purdue.edu>
llvm-svn: 176900
This commit is contained in:
Tobias Grosser
2013-03-12 21:27:39 +00:00
parent 34cf820b8a
commit 7f54714dcc
6 changed files with 18 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed -stats < %s 2>&1 | FileCheck %s
; REQUIRES: assert
; REQUIRES: asserts
;int A[100];
;int B[100];

View File

@@ -1,5 +1,5 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s -stats 2>&1 | FileCheck %s
; REQUIRES: assert
; REQUIRES: asserts
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-linux-gnu"

View File

@@ -1,5 +1,5 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s -stats 2>&1 | FileCheck %s
; REQUIRES: assert
; REQUIRES: asserts
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-linux-gnu"

View File

@@ -1,5 +1,5 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s -stats 2>&1 | FileCheck %s
; REQUIRES: assert
; REQUIRES: asserts
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-linux-gnu"

View File

@@ -1,5 +1,5 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze < %s -stats 2>&1 | FileCheck %s
; REQUIRES: assert
; REQUIRES: asserts
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-linux-gnu"

View File

@@ -2,6 +2,7 @@
import os
import platform
import re
# Configuration file for the 'lit' test runner.
@@ -95,3 +96,15 @@ if config.test_exec_root is None:
lit.load_config(config, site_cfg)
raise SystemExit
# llc knows whether he 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()