Skip to content

Commit

Permalink
[lit] support dxopt in lit (#5515)
Browse files Browse the repository at this point in the history
When input is from stdin, need to add '\n' after each line.

This is for use dxopt to test pix passes.
opt doesn't support passes which has parameters right now. We could
switch it to opt once pass parameter is supported.
  • Loading branch information
python3kgae authored Aug 9, 2023
1 parent 41c3ee2 commit 375b667
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %dxc -Emain -Tas_6_5 %s | %opt -S -hlsl-dxil-debug-instrumentation,parameter0=10,parameter1=20,parameter2=30 | %FileCheck %s
// RUN: %dxc -Emain -Tas_6_5 %s | %dxopt - -S -hlsl-dxil-debug-instrumentation,parameter0=10,parameter1=20,parameter2=30 | FileCheck %s

// Check that the AS thread IDs are added properly

Expand Down
4 changes: 2 additions & 2 deletions tools/clang/tools/dxopt/dxopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ static HRESULT ReadStdin(std::string &input) {
std::getline(std::cin, line);
if (line.empty()) {
emptyLine = true;
break;
continue;
}

std::copy(line.begin(), line.end(),
std::back_inserter(input));
input.push_back('\n');
}

DWORD lastError = GetLastError();

// Make sure we reached finished successfully.
if (std::cin.eof())
return S_OK;
Expand Down

0 comments on commit 375b667

Please sign in to comment.