Skip to content

Commit 375b667

Browse files
authored
[lit] support dxopt in lit (microsoft#5515)
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.
1 parent 41c3ee2 commit 375b667

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tools/clang/test/HLSLFileCheck/pix/DebugAs.hlsl renamed to tools/clang/test/PIX/DebugAs.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -Emain -Tas_6_5 %s | %opt -S -hlsl-dxil-debug-instrumentation,parameter0=10,parameter1=20,parameter2=30 | %FileCheck %s
1+
// RUN: %dxc -Emain -Tas_6_5 %s | %dxopt - -S -hlsl-dxil-debug-instrumentation,parameter0=10,parameter1=20,parameter2=30 | FileCheck %s
22

33
// Check that the AS thread IDs are added properly
44

tools/clang/tools/dxopt/dxopt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ static HRESULT ReadStdin(std::string &input) {
6969
std::getline(std::cin, line);
7070
if (line.empty()) {
7171
emptyLine = true;
72-
break;
72+
continue;
7373
}
7474

7575
std::copy(line.begin(), line.end(),
7676
std::back_inserter(input));
77+
input.push_back('\n');
7778
}
7879

7980
DWORD lastError = GetLastError();
80-
8181
// Make sure we reached finished successfully.
8282
if (std::cin.eof())
8383
return S_OK;

0 commit comments

Comments
 (0)