Do not run GPGPU test cases without nvptx target

Tag the GPGPU codegen test cases as unsupported if the nvptx target is not
included in the current llvm build.

Contributed-by:  Yabin Hu <yabin.hwu@gmail.com>
llvm-svn: 208779
This commit is contained in:
Tobias Grosser 2014-05-14 14:18:14 +00:00
parent b2e723e448
commit 5f860fdfe9
4 changed files with 16 additions and 1 deletions

View File

@ -62,7 +62,7 @@ if (NOT DEFINED LLVM_MAIN_SRC_DIR)
else (NOT DEFINED LLVM_MAIN_SRC_DIR)
set(LLVM_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit)
set(POLLY_TEST_DEPS opt LLVMPolly FileCheck not)
set(POLLY_TEST_DEPS llvm-config opt LLVMPolly FileCheck not)
set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}")

View File

@ -1,3 +1,4 @@
; REQUIRES: nvptx-registered-target
; RUN: opt %loadPolly -basicaa -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed+gpu -enable-polly-gpgpu -polly-gpgpu-triple=nvptx64-unknown-unknown -polly-codegen < %s -S | FileCheck %s
;int A[128][128];

View File

@ -1,3 +1,4 @@
; REQUIRES: nvptx-registered-target
; RUN: opt %loadPolly -basicaa -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed+gpu -enable-polly-gpgpu -polly-gpgpu-triple=nvptx64-unknown-unknown -polly-codegen < %s -S | FileCheck %s
;int A[128][128];

View File

@ -111,3 +111,16 @@ except OSError, why:
if re.search(r'with assertions', opt_cmd.stdout.read()):
config.available_features.add('asserts')
opt_cmd.wait()
try:
llvm_config_cmd = subprocess.Popen([os.path.join(llvm_tools_dir,
'llvm-config'),
'--targets-built'],
stdout = subprocess.PIPE)
except OSError, why:
print "Could not find llvm-config in " + llvm_tools_dir
exit(42)
if re.search(r'NVPTX', llvm_config_cmd.stdout.read()):
config.available_features.add('nvptx-registered-target')
llvm_config_cmd.wait()