From f25ad24d1b35158ef7b512773bc25b2824c4e50b Mon Sep 17 00:00:00 2001 From: Antonio Maiorano Date: Mon, 10 May 2021 21:11:36 +0000 Subject: [PATCH] Fix test: "unknown case statement" from spirv reader Bug found when passing program through spirv writer and then reader. Bug: tint:792 Change-Id: I904b959ba1d540b4377f8b9027286182ee0c34e9 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/50561 Commit-Queue: Antonio Maiorano Reviewed-by: Ben Clayton --- src/resolver/resolver_test.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/resolver/resolver_test.cc b/src/resolver/resolver_test.cc index fcfde03352..5464105dda 100644 --- a/src/resolver/resolver_test.cc +++ b/src/resolver/resolver_test.cc @@ -83,7 +83,9 @@ TEST_F(ResolverTest, Stmt_Case) { ast::CaseSelectorList lit; lit.push_back(create(3)); auto* cse = create(lit, block); - WrapInFunction(v, cse); + auto* cond_var = Var("c", ty.i32(), ast::StorageClass::kFunction); + auto* sw = Switch(cond_var, cse, DefaultCase()); + WrapInFunction(v, cond_var, sw); EXPECT_TRUE(r()->Resolve()) << r()->error();