diff --git a/llvm/test/CodeGen/NVPTX/access-non-generic.ll b/llvm/test/CodeGen/NVPTX/access-non-generic.ll --- a/llvm/test/CodeGen/NVPTX/access-non-generic.ll +++ b/llvm/test/CodeGen/NVPTX/access-non-generic.ll @@ -1,5 +1,11 @@ -; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s --check-prefix PTX -; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s --check-prefix PTX +; RUN: llc < %s -march=nvptx -mcpu=sm_20 -o %t-nvptx.ptx +; RUN: FileCheck %s --input-file %t-nvptx.ptx --check-prefix PTX +; RUN: ptxas -c %t-nvptx.ptx -o /dev/null + +; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -o %t-nvptx64.ptx +; RUN: FileCheck %s --input-file %t-nvptx64.ptx --check-prefix PTX +; RUN: ptxas -c %t-nvptx64.ptx -o /dev/null + ; RUN: opt -mtriple=nvptx-- < %s -S -infer-address-spaces | FileCheck %s --check-prefix IR ; RUN: opt -mtriple=nvptx64-- < %s -S -infer-address-spaces | FileCheck %s --check-prefix IR diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py --- a/llvm/test/lit.cfg.py +++ b/llvm/test/lit.cfg.py @@ -191,6 +191,13 @@ ToolSubst('OrcV2CBindingsLazy', unresolved='ignore'), ToolSubst('OrcV2CBindingsVeryLazy', unresolved='ignore')]) +# Add ptxas if it is available +ptxas_executable = 'true' +if config.ptxas_executable: + ptxas_executable = config.ptxas_executable +tools.extend([ + ToolSubst('ptxas', ptxas_executable, unresolved='ignore')]) + llvm_config.add_tool_substitutions(tools, config.llvm_tools_dir) # Targets diff --git a/llvm/test/lit.site.cfg.py.in b/llvm/test/lit.site.cfg.py.in --- a/llvm/test/lit.site.cfg.py.in +++ b/llvm/test/lit.site.cfg.py.in @@ -23,6 +23,7 @@ config.ocaml_flags = "@OCAMLFLAGS@" config.include_go_tests = @LLVM_INCLUDE_GO_TESTS@ config.go_executable = "@GO_EXECUTABLE@" +config.ptxas_executable = "@PXTAS_EXECUTABLE@" config.enable_shared = @ENABLE_SHARED@ config.enable_assertions = @ENABLE_ASSERTIONS@ config.targets_to_build = "@TARGETS_TO_BUILD@"