wgsl: Deprecate '-> void' on functions

Was removed with:
https://github.com/gpuweb/gpuweb/pull/1460

Bug: tint:677
Change-Id: If08cb450189c6158561051ef6e8f2439c60bc010
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/47140
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2021-04-08 14:39:47 +00:00
committed by Commit Bot service account
parent d15391e802
commit 9328d94572
48 changed files with 645 additions and 600 deletions

View File

@@ -48,7 +48,7 @@ TEST_F(ResolverFunctionValidationTest, FunctionNamesMustBeUnique_fail) {
TEST_F(ResolverFunctionValidationTest,
VoidFunctionEndWithoutReturnStatement_Pass) {
// [[stage(vertex)]]
// fn func -> void { var a:i32 = 2; }
// fn func { var a:i32 = 2; }
auto* var = Var("a", ty.i32(), ast::StorageClass::kNone, Expr(2));
Func(Source{Source::Location{12, 34}}, "func", ast::VariableList{},
@@ -83,7 +83,7 @@ TEST_F(ResolverFunctionValidationTest, FunctionEndWithoutReturnStatement_Fail) {
TEST_F(ResolverFunctionValidationTest,
VoidFunctionEndWithoutReturnStatementEmptyBody_Pass) {
// [[stage(vertex)]]
// fn func -> void {}
// fn func {}
Func(Source{Source::Location{12, 34}}, "func", ast::VariableList{},
ty.void_(), ast::StatementList{},
@@ -110,7 +110,7 @@ TEST_F(ResolverFunctionValidationTest,
TEST_F(ResolverFunctionValidationTest,
FunctionTypeMustMatchReturnStatementType_Pass) {
// [[stage(vertex)]]
// fn func -> void { return; }
// fn func { return; }
Func("func", ast::VariableList{}, ty.void_(),
ast::StatementList{
@@ -125,7 +125,7 @@ TEST_F(ResolverFunctionValidationTest,
TEST_F(ResolverFunctionValidationTest,
FunctionTypeMustMatchReturnStatementType_fail) {
// fn func -> void { return 2; }
// fn func { return 2; }
Func("func", ast::VariableList{}, ty.void_(),
ast::StatementList{
create<ast::ReturnStatement>(Source{Source::Location{12, 34}},
@@ -216,7 +216,7 @@ TEST_F(ResolverFunctionValidationTest,
TEST_F(ResolverFunctionValidationTest, PipelineStage_MustBeUnique_Fail) {
// [[stage(fragment)]]
// [[stage(vertex)]]
// fn main() -> void { return; }
// fn main() { return; }
Func(Source{Source::Location{12, 34}}, "main", ast::VariableList{},
ty.void_(),
ast::StatementList{
@@ -244,7 +244,7 @@ TEST_F(ResolverFunctionValidationTest, NoPipelineEntryPoints) {
}
TEST_F(ResolverFunctionValidationTest, FunctionVarInitWithParam) {
// fn foo(bar : f32) -> void{
// fn foo(bar : f32){
// var baz : f32 = bar;
// }
@@ -258,7 +258,7 @@ TEST_F(ResolverFunctionValidationTest, FunctionVarInitWithParam) {
}
TEST_F(ResolverFunctionValidationTest, FunctionConstInitWithParam) {
// fn foo(bar : f32) -> void{
// fn foo(bar : f32){
// const baz : f32 = bar;
// }

View File

@@ -285,7 +285,7 @@ TEST_F(ResolverTest, Stmt_VariableDecl_ModuleScope) {
}
TEST_F(ResolverTest, Stmt_VariableDecl_OuterScopeAfterInnerScope) {
// fn func_i32() -> void {
// fn func_i32() {
// {
// var foo : i32 = 2;
// var bar : i32 = foo;
@@ -345,11 +345,11 @@ TEST_F(ResolverTest, Stmt_VariableDecl_OuterScopeAfterInnerScope) {
}
TEST_F(ResolverTest, Stmt_VariableDecl_ModuleScopeAfterFunctionScope) {
// fn func_i32() -> void {
// fn func_i32() {
// var foo : i32 = 2;
// }
// var foo : f32 = 2.0;
// fn func_f32() -> void {
// fn func_f32() {
// var bar : f32 = foo;
// }

View File

@@ -154,7 +154,7 @@ TEST_P(InferTypeTest_FromCallExpression, All) {
// return vec3<f32>(0.0, 0.0, 0.0);
// }
//
// fn bar() -> void
// fn bar()
// {
// var a = foo();
// }

View File

@@ -111,7 +111,7 @@ TEST_F(ResolverTypeValidationTest, GlobalVariableNotUnique_Fail) {
TEST_F(ResolverTypeValidationTest,
GlobalVariableFunctionVariableNotUnique_Pass) {
// fn my_func -> void {
// fn my_func() {
// var a: f32 = 2.0;
// }
// var a: f32 = 2.1;
@@ -130,7 +130,7 @@ TEST_F(ResolverTypeValidationTest,
TEST_F(ResolverTypeValidationTest,
GlobalVariableFunctionVariableNotUnique_Fail) {
// var a: f32 = 2.1;
// fn my_func -> void {
// fn my_func() {
// var a: f32 = 2.0;
// return 0;
// }
@@ -150,7 +150,7 @@ TEST_F(ResolverTypeValidationTest,
}
TEST_F(ResolverTypeValidationTest, RedeclaredIdentifier_Fail) {
// fn my_func() -> void {
// fn my_func()() {
// var a :i32 = 2;
// var a :f21 = 2.0;
// }
@@ -293,7 +293,7 @@ TEST_F(ResolverTypeValidationTest,
TEST_F(ResolverTypeValidationTest, RuntimeArrayInFunction_Fail) {
/// [[stage(vertex)]]
// fn func -> void { var a : array<i32>; }
// fn func() { var a : array<i32>; }
auto* var =
Var(Source{{12, 34}}, "a", ty.array<i32>(), ast::StorageClass::kNone);

View File

@@ -83,8 +83,8 @@ TEST_F(ResolverValidationTest, Stmt_Error_Unknown) {
}
TEST_F(ResolverValidationTest, Stmt_Call_undeclared) {
// fn main() -> void {func(); return; }
// fn func() -> void { return; }
// fn main() {func(); return; }
// fn func() { return; }
SetSource(Source::Location{12, 34});
auto* call_expr = Call("func");
@@ -110,7 +110,7 @@ TEST_F(ResolverValidationTest, Stmt_Call_undeclared) {
}
TEST_F(ResolverValidationTest, Stmt_Call_recursive) {
// fn main() -> void {main(); }
// fn main() {main(); }
SetSource(Source::Location{12, 34});
auto* call_expr = Call("main");
@@ -241,7 +241,7 @@ TEST_F(ResolverValidationTest, UsingUndefinedVariableInBlockStatement_Fail) {
}
TEST_F(ResolverValidationTest, UsingUndefinedVariableGlobalVariableAfter_Fail) {
// fn my_func() -> void {
// fn my_func() {
// global_var = 3.14f;
// }
// var global_var: f32 = 2.1;
@@ -266,7 +266,7 @@ TEST_F(ResolverValidationTest, UsingUndefinedVariableGlobalVariableAfter_Fail) {
TEST_F(ResolverValidationTest, UsingUndefinedVariableGlobalVariable_Pass) {
// var global_var: f32 = 2.1;
// fn my_func() -> void {
// fn my_func() {
// global_var = 3.14;
// return;
// }