Add tests for recently added command line option (#3297)

We have not added tests for the new command line options recently.  I've
updated the test and fixed on option that was incorrect.

Fixes #3247
This commit is contained in:
Steven Perron 2020-04-14 12:57:06 -04:00 committed by GitHub
parent ca5751590e
commit 4956644894
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -498,7 +498,7 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) {
} else if (pass_name == "legalize-vector-shuffle") { } else if (pass_name == "legalize-vector-shuffle") {
RegisterPass(CreateLegalizeVectorShufflePass()); RegisterPass(CreateLegalizeVectorShufflePass());
} else if (pass_name == "split-invalid-unreachable") { } else if (pass_name == "split-invalid-unreachable") {
RegisterPass(CreateLegalizeVectorShufflePass()); RegisterPass(CreateSplitInvalidUnreachablePass());
} else if (pass_name == "decompose-initialized-variables") { } else if (pass_name == "decompose-initialized-variables") {
RegisterPass(CreateDecomposeInitializedVariablesPass()); RegisterPass(CreateDecomposeInitializedVariablesPass());
} else if (pass_name == "graphics-robust-access") { } else if (pass_name == "graphics-robust-access") {

View File

@ -73,7 +73,10 @@ class TestValidPassFlags(expect.ValidObjectFile1_5,
'--remove-duplicates', '--replace-invalid-opcode', '--ssa-rewrite', '--remove-duplicates', '--replace-invalid-opcode', '--ssa-rewrite',
'--scalar-replacement', '--scalar-replacement=42', '--strength-reduction', '--scalar-replacement', '--scalar-replacement=42', '--strength-reduction',
'--strip-debug', '--strip-reflect', '--vector-dce', '--workaround-1209', '--strip-debug', '--strip-reflect', '--vector-dce', '--workaround-1209',
'--unify-const' '--unify-const', '--legalize-vector-shuffle',
'--split-invalid-unreachable', '--generate-webgpu-initializers',
'--decompose-initialized-variables', '--graphics-robust-access',
'--wrap-opkill', '--amd-ext-to-khr'
] ]
expected_passes = [ expected_passes = [
'wrap-opkill', 'wrap-opkill',
@ -120,7 +123,14 @@ class TestValidPassFlags(expect.ValidObjectFile1_5,
'strip-reflect', 'strip-reflect',
'vector-dce', 'vector-dce',
'workaround-1209', 'workaround-1209',
'unify-const' 'unify-const',
'legalize-vector-shuffle',
'split-invalid-unreachable',
'generate-webgpu-initializers',
'decompose-initialized-variables',
'graphics-robust-access',
'wrap-opkill',
'amd-ext-to-khr'
] ]
shader = placeholder.FileSPIRVShader(empty_main_assembly(), '.spvasm') shader = placeholder.FileSPIRVShader(empty_main_assembly(), '.spvasm')
output = placeholder.TempFileName('output.spv') output = placeholder.TempFileName('output.spv')