Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion clang/lib/Driver/ToolChains/SPIRV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ void SPIRV::constructTranslateCommand(Compilation &C, const Tool &T,

if (Input.getType() == types::TY_PP_Asm)
CmdArgs.push_back("-to-binary");

// The text output from spirv-dis is not in the format expected
// by llvm-spirv, so use the text output from llvm-spirv.
if (Output.getType() == types::TY_PP_Asm)
CmdArgs.push_back("--spirv-tools-dis");
CmdArgs.push_back("-to-text");

CmdArgs.append({"-o", Output.getFilename()});

Expand Down
6 changes: 3 additions & 3 deletions clang/test/Driver/spirv-toolchain.cl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

// SPT64: "-cc1" "-triple" "spirv64"
// SPT64-SAME: "-o" [[BC:".*bc"]]
// SPT64: {{llvm-spirv.*"}} [[BC]] "--spirv-tools-dis" "-o" {{".*s"}}
// SPT64: {{llvm-spirv.*"}} [[BC]] "-to-text" "-o" {{".*s"}}

// RUN: %clang -### --target=spirv32 -x cl -S %s 2>&1 | FileCheck --check-prefix=SPT32 %s
// RUN: %clang -### --target=spirv32 -x ir -S %s 2>&1 | FileCheck --check-prefix=SPT32 %s
Expand All @@ -37,7 +37,7 @@

// SPT32: "-cc1" "-triple" "spirv32"
// SPT32-SAME: "-o" [[BC:".*bc"]]
// SPT32: {{llvm-spirv.*"}} [[BC]] "--spirv-tools-dis" "-o" {{".*s"}}
// SPT32: {{llvm-spirv.*"}} [[BC]] "-to-text" "-o" {{".*s"}}

//-----------------------------------------------------------------------------
// Check assembly input -> object output
Expand All @@ -55,7 +55,7 @@
// TMP: "-cc1" "-triple" "spirv64"
// TMP-SAME: "-o" [[BC:".*bc"]]
// TMP-SAME: [[I]]
// TMP: {{llvm-spirv.*"}} [[BC]] "--spirv-tools-dis" "-o" [[S:".*s"]]
// TMP: {{llvm-spirv.*"}} [[BC]] "-to-text" "-o" [[S:".*s"]]
// TMP: {{llvm-spirv.*"}} [[S]] "-to-binary" "-o" {{".*o"}}

//-----------------------------------------------------------------------------
Expand Down
Loading