spirv-reader: update tests to use valid SPIR-V
This CL: all SPIR-V modules in parser_impl_module_var_test.cc Bug: tint:765 Change-Id: I2e8427aea729793a4e34e2ac0c6fc689f65bda04 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49645 Auto-Submit: David Neto <dneto@google.com> Commit-Queue: David Neto <dneto@google.com> Reviewed-by: Alan Baker <alanbaker@google.com>
This commit is contained in:
parent
202d97d846
commit
ba08d7bca3
File diff suppressed because it is too large
Load Diff
|
@ -27,8 +27,8 @@ ParserImplWrapperForTest::ParserImplWrapperForTest(
|
||||||
: impl_(input) {}
|
: impl_(input) {}
|
||||||
|
|
||||||
ParserImplWrapperForTest::~ParserImplWrapperForTest() {
|
ParserImplWrapperForTest::~ParserImplWrapperForTest() {
|
||||||
if (dump_successfully_converted_spirv_ && !impl_.spv_binary().empty() &&
|
if (dump_successfully_converted_spirv_ && !deliberately_invalid_spirv_ &&
|
||||||
impl_.success()) {
|
!impl_.spv_binary().empty() && impl_.success()) {
|
||||||
std::string disassembly = Disassemble(impl_.spv_binary());
|
std::string disassembly = Disassemble(impl_.spv_binary());
|
||||||
std::cout << "BEGIN ConvertedOk:\n"
|
std::cout << "BEGIN ConvertedOk:\n"
|
||||||
<< disassembly << "\nEND ConvertedOk" << std::endl;
|
<< disassembly << "\nEND ConvertedOk" << std::endl;
|
||||||
|
|
|
@ -49,6 +49,7 @@ class ParserImplWrapperForTest {
|
||||||
static void DumpSuccessfullyConvertedSpirv() {
|
static void DumpSuccessfullyConvertedSpirv() {
|
||||||
dump_successfully_converted_spirv_ = true;
|
dump_successfully_converted_spirv_ = true;
|
||||||
}
|
}
|
||||||
|
void DeliberatelyInvalidSpirv() { deliberately_invalid_spirv_ = true; }
|
||||||
|
|
||||||
// Returns a new function emitter for the given function ID.
|
// Returns a new function emitter for the given function ID.
|
||||||
// Assumes ParserImpl::BuildInternalRepresentation has been run and
|
// Assumes ParserImpl::BuildInternalRepresentation has been run and
|
||||||
|
@ -123,6 +124,9 @@ class ParserImplWrapperForTest {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ParserImpl impl_;
|
ParserImpl impl_;
|
||||||
|
// When true, indicates the input SPIR-V module is expected to fail
|
||||||
|
// validation, but the SPIR-V reader parser is permissive and lets it through.
|
||||||
|
bool deliberately_invalid_spirv_ = false;
|
||||||
static bool dump_successfully_converted_spirv_;
|
static bool dump_successfully_converted_spirv_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue