From bff3b7831382de3cdb437f0013170728a0bf0ee6 Mon Sep 17 00:00:00 2001 From: David Neto Date: Mon, 8 Jun 2020 15:26:18 +0000 Subject: [PATCH] [spirv-reader] Add cases for mergeless OpSwitch This is a bit pathological. Bug: tint:3 Change-Id: I448796c712049f88cef9a592c218d94a0daddb75 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22760 Reviewed-by: dan sinclair --- src/reader/spirv/function_cfg_test.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/reader/spirv/function_cfg_test.cc b/src/reader/spirv/function_cfg_test.cc index 0d192c5b56..c2887dc1a1 100644 --- a/src/reader/spirv/function_cfg_test.cc +++ b/src/reader/spirv/function_cfg_test.cc @@ -8794,6 +8794,28 @@ Return{} )")) << ToString(fe.ast_body()); } +// For normal terminator that is OpBranchConditional, the kBack, kForward, +// kIfBreak are all invalid proven in earlier tests. +TEST_F(SpvParserTest, DISABLED_EmitBody_BranchConditional_Fallthrough_Fallthrough_Same) { + // Can only be to the same target. + // TODO(dneto): needs switch support +} +TEST_F(SpvParserTest, + DISABLED_EmitBody_BranchConditional_Fallthrough_Fallthrough_Different_IsError) { + // TODO(dneto): needs switch support +} +TEST_F(SpvParserTest, DISABLED_EmitBody_BranchConditional_Fallthrough_LoopBreak) { + // TODO(dneto): needs switch support +} +TEST_F(SpvParserTest, DISABLED_EmitBody_BranchConditional_Fallthrough_SwitchBreak) { + // TODO(dneto): needs switch support +} +TEST_F(SpvParserTest, DISABLED_EmitBody_BranchConditional_Fallthrough_LoopContinue) { + // TODO(dneto): needs switch support +} + +// TODO(dneto): test normal OpBranchConditional with other than Fallthrough + TEST_F(SpvParserTest, DISABLED_Switch_NotAsSelectionHeader_NonDefaultBranchesAreContinue) { // Adapted from SPIRV-Tools test MissingMergeOneUnseenTargetSwitchGood