Allow function declarations to take (void).

This is allowed by GLSL, so we allow it too.

GLSL ES 1.0, Section 6.1: "The idiom “(void)” as a parameter list is
provided for convenience."

Change-Id: I551c505d3de518a75acd5e306f09f0f0767e43f2
Bug: skia:12025
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411300
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/gn/sksl_tests.gni b/gn/sksl_tests.gni
index b6c9e1e..e0fd766 100644
--- a/gn/sksl_tests.gni
+++ b/gn/sksl_tests.gni
@@ -122,6 +122,7 @@
   "/sksl/errors/FloatRemainder.sksl",
   "/sksl/errors/ForInitStmt.sksl",
   "/sksl/errors/ForTypeMismatch.sksl",
+  "/sksl/errors/FunctionParameterOfVoid.sksl",
   "/sksl/errors/GenericArgumentMismatch.sksl",
   "/sksl/errors/IfTypeMismatch.sksl",
   "/sksl/errors/InVarWithInitializerExpression.sksl",
diff --git a/resources/sksl/errors/ArrayOfVoid.sksl b/resources/sksl/errors/ArrayOfVoid.sksl
index c56cdb1..8bafbbe 100644
--- a/resources/sksl/errors/ArrayOfVoid.sksl
+++ b/resources/sksl/errors/ArrayOfVoid.sksl
@@ -3,8 +3,6 @@
 void a[2];
 void[2] b;
 
-void funcD(void d[2]) {}
-void funcE(void[2] e) {}
 void[2] funcF() {}
 void funcG() { void g[2]; }
 void funcH() { void[2] h; }
diff --git a/resources/sksl/errors/FunctionParameterOfVoid.sksl b/resources/sksl/errors/FunctionParameterOfVoid.sksl
new file mode 100644
index 0000000..fcae990
--- /dev/null
+++ b/resources/sksl/errors/FunctionParameterOfVoid.sksl
@@ -0,0 +1 @@
+void func(void x) {}
diff --git a/resources/sksl/shared/FunctionArgTypeMatch.sksl b/resources/sksl/shared/FunctionArgTypeMatch.sksl
index 8b1ebf6..46d9731 100644
--- a/resources/sksl/shared/FunctionArgTypeMatch.sksl
+++ b/resources/sksl/shared/FunctionArgTypeMatch.sksl
@@ -1,5 +1,7 @@
 uniform half4 colorGreen, colorRed;
 
+bool takes_nothing (          )         { return true; }
+bool takes_void    (void      )         { return true; }
 bool takes_float   (float    x)         { return true; }
 bool takes_float2  (float2   x)         { return true; }
 bool takes_float3  (float3   x)         { return true; }
@@ -24,7 +26,9 @@
 bool takes_int4    (int4     x)         { return true; }
 
 half4 main(float2 coords) {
-    return takes_float   (float    (1))    &&
+    return takes_nothing ()                &&
+           takes_void    ()                &&
+           takes_float   (float    (1))    &&
            takes_float2  (float2   (2))    &&
            takes_float3  (float3   (3))    &&
            takes_float4  (float4   (4))    &&
diff --git a/src/sksl/SkSLParser.cpp b/src/sksl/SkSLParser.cpp
index 004d625..2e93694 100644
--- a/src/sksl/SkSLParser.cpp
+++ b/src/sksl/SkSLParser.cpp
@@ -431,8 +431,8 @@
     return result;
 }
 
-/* enumDeclaration | modifiers (structVarDeclaration | type IDENTIFIER ((LPAREN parameter
-   (COMMA parameter)* RPAREN (block | SEMICOLON)) | SEMICOLON) | interfaceBlock) */
+/* enumDeclaration | modifiers (interfaceBlock | structVarDeclaration | SEMICOLON |
+   type IDENTIFIER (varDeclarationEnd | LPAREN functionDeclarationEnd))) */
 ASTNode::ID Parser::declaration() {
     Token lookahead = this->peek();
     switch (lookahead.fKind) {
@@ -466,40 +466,53 @@
         return ASTNode::ID::Invalid();
     }
     if (this->checkNext(Token::Kind::TK_LPAREN)) {
-        ASTNode::ID result = this->createNode(name.fOffset, ASTNode::Kind::kFunction);
-        ASTNode::FunctionData fd(modifiers, this->text(name), 0);
-        getNode(result).addChild(type);
-        if (this->peek().fKind != Token::Kind::TK_RPAREN) {
-            for (;;) {
-                ASTNode::ID parameter = this->parameter();
-                if (!parameter) {
-                    return ASTNode::ID::Invalid();
-                }
-                ++fd.fParameterCount;
-                getNode(result).addChild(parameter);
-                if (!this->checkNext(Token::Kind::TK_COMMA)) {
-                    break;
-                }
-            }
-        }
-        getNode(result).setFunctionData(fd);
-        if (!this->expect(Token::Kind::TK_RPAREN, "')'")) {
-            return ASTNode::ID::Invalid();
-        }
-        ASTNode::ID body;
-        if (!this->checkNext(Token::Kind::TK_SEMICOLON)) {
-            body = this->block();
-            if (!body) {
-                return ASTNode::ID::Invalid();
-            }
-            getNode(result).addChild(body);
-        }
-        return result;
+        return this->functionDeclarationEnd(modifiers, type, name);
     } else {
         return this->varDeclarationEnd(modifiers, type, this->text(name));
     }
 }
 
+/* (RPAREN | VOID RPAREN | parameter (COMMA parameter)* RPAREN) (block | SEMICOLON) */
+ASTNode::ID Parser::functionDeclarationEnd(Modifiers modifiers,
+                                           ASTNode::ID type,
+                                           const Token& name) {
+    ASTNode::ID result = this->createNode(name.fOffset, ASTNode::Kind::kFunction);
+    ASTNode::FunctionData fd(modifiers, this->text(name), 0);
+    getNode(result).addChild(type);
+    Token lookahead = this->peek();
+    if (lookahead.fKind == Token::Kind::TK_RPAREN) {
+        // `()` means no parameters at all.
+    } else if (lookahead.fKind == Token::Kind::TK_IDENTIFIER && this->text(lookahead) == "void") {
+        // `(void)` also means no parameters at all.
+        this->nextToken();
+    } else {
+        for (;;) {
+            ASTNode::ID parameter = this->parameter();
+            if (!parameter) {
+                return ASTNode::ID::Invalid();
+            }
+            ++fd.fParameterCount;
+            getNode(result).addChild(parameter);
+            if (!this->checkNext(Token::Kind::TK_COMMA)) {
+                break;
+            }
+        }
+    }
+    getNode(result).setFunctionData(fd);
+    if (!this->expect(Token::Kind::TK_RPAREN, "')'")) {
+        return ASTNode::ID::Invalid();
+    }
+    ASTNode::ID body;
+    if (!this->checkNext(Token::Kind::TK_SEMICOLON)) {
+        body = this->block();
+        if (!body) {
+            return ASTNode::ID::Invalid();
+        }
+        getNode(result).addChild(body);
+    }
+    return result;
+}
+
 /* (varDeclarations | expressionStatement) */
 ASTNode::ID Parser::varDeclarationsOrExpressionStatement() {
     Token nextToken = this->peek();
diff --git a/src/sksl/SkSLParser.h b/src/sksl/SkSLParser.h
index e7f22b2..f343d35 100644
--- a/src/sksl/SkSLParser.h
+++ b/src/sksl/SkSLParser.h
@@ -152,6 +152,8 @@
 
     ASTNode::ID declaration();
 
+    ASTNode::ID functionDeclarationEnd(Modifiers modifiers, ASTNode::ID type, const Token& name);
+
     struct VarDeclarationsPrefix {
         Modifiers modifiers;
         ASTNode::ID type;
diff --git a/tests/sksl/errors/ArrayOfVoid.glsl b/tests/sksl/errors/ArrayOfVoid.glsl
index efe8735..8988a7b 100644
--- a/tests/sksl/errors/ArrayOfVoid.glsl
+++ b/tests/sksl/errors/ArrayOfVoid.glsl
@@ -2,9 +2,7 @@
 
 error: 3: type 'void' not allowed in this context
 error: 4: type 'void' not allowed in this context
-error: 6: type 'void' not allowed in this context
+error: 6: type 'void' may not be used in an array
 error: 7: type 'void' not allowed in this context
-error: 8: type 'void' may not be used in an array
-error: 9: type 'void' not allowed in this context
-error: 10: type 'void' not allowed in this context
-7 errors
+error: 8: type 'void' not allowed in this context
+5 errors
diff --git a/tests/sksl/errors/FunctionParameterOfVoid.glsl b/tests/sksl/errors/FunctionParameterOfVoid.glsl
new file mode 100644
index 0000000..9d2fdd8
--- /dev/null
+++ b/tests/sksl/errors/FunctionParameterOfVoid.glsl
@@ -0,0 +1,4 @@
+### Compilation failed:
+
+error: 1: expected ')', but found 'x'
+1 error
diff --git a/tests/sksl/shared/FunctionArgTypeMatch.asm.frag b/tests/sksl/shared/FunctionArgTypeMatch.asm.frag
index f969558..47b5fbd 100644
--- a/tests/sksl/shared/FunctionArgTypeMatch.asm.frag
+++ b/tests/sksl/shared/FunctionArgTypeMatch.asm.frag
@@ -9,6 +9,8 @@
 OpMemberName %_UniformBuffer 0 "colorGreen"
 OpMemberName %_UniformBuffer 1 "colorRed"
 OpName %_entrypoint_v "_entrypoint_v"
+OpName %takes_void_b "takes_void_b"
+OpName %takes_float_bf "takes_float_bf"
 OpName %takes_float2_bf2 "takes_float2_bf2"
 OpName %takes_float3_bf3 "takes_float3_bf3"
 OpName %takes_float4_bf4 "takes_float4_bf4"
@@ -40,23 +42,23 @@
 OpMemberDecorate %_UniformBuffer 1 Offset 16
 OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
 OpDecorate %_UniformBuffer Block
-OpDecorate %31 Binding 0
-OpDecorate %31 DescriptorSet 0
-OpDecorate %202 RelaxedPrecision
-OpDecorate %203 RelaxedPrecision
-OpDecorate %204 RelaxedPrecision
-OpDecorate %210 RelaxedPrecision
-OpDecorate %211 RelaxedPrecision
-OpDecorate %212 RelaxedPrecision
-OpDecorate %213 RelaxedPrecision
+OpDecorate %33 Binding 0
+OpDecorate %33 DescriptorSet 0
+OpDecorate %217 RelaxedPrecision
+OpDecorate %218 RelaxedPrecision
 OpDecorate %219 RelaxedPrecision
-OpDecorate %220 RelaxedPrecision
-OpDecorate %221 RelaxedPrecision
-OpDecorate %222 RelaxedPrecision
-OpDecorate %223 RelaxedPrecision
-OpDecorate %284 RelaxedPrecision
-OpDecorate %286 RelaxedPrecision
-OpDecorate %287 RelaxedPrecision
+OpDecorate %225 RelaxedPrecision
+OpDecorate %226 RelaxedPrecision
+OpDecorate %227 RelaxedPrecision
+OpDecorate %228 RelaxedPrecision
+OpDecorate %234 RelaxedPrecision
+OpDecorate %235 RelaxedPrecision
+OpDecorate %236 RelaxedPrecision
+OpDecorate %237 RelaxedPrecision
+OpDecorate %238 RelaxedPrecision
+OpDecorate %299 RelaxedPrecision
+OpDecorate %301 RelaxedPrecision
+OpDecorate %302 RelaxedPrecision
 %float = OpTypeFloat 32
 %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -66,418 +68,444 @@
 %sk_Clockwise = OpVariable %_ptr_Input_bool Input
 %_UniformBuffer = OpTypeStruct %v4float %v4float
 %_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
-%31 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
+%33 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
 %void = OpTypeVoid
-%36 = OpTypeFunction %void
+%38 = OpTypeFunction %void
 %v2float = OpTypeVector %float 2
 %float_0 = OpConstant %float 0
-%40 = OpConstantComposite %v2float %float_0 %float_0
+%42 = OpConstantComposite %v2float %float_0 %float_0
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-%44 = OpTypeFunction %bool %_ptr_Function_v2float
+%46 = OpTypeFunction %bool
 %true = OpConstantTrue %bool
+%_ptr_Function_float = OpTypePointer Function %float
+%49 = OpTypeFunction %bool %_ptr_Function_float
+%53 = OpTypeFunction %bool %_ptr_Function_v2float
 %v3float = OpTypeVector %float 3
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-%49 = OpTypeFunction %bool %_ptr_Function_v3float
+%57 = OpTypeFunction %bool %_ptr_Function_v3float
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-%53 = OpTypeFunction %bool %_ptr_Function_v4float
+%61 = OpTypeFunction %bool %_ptr_Function_v4float
 %mat2v2float = OpTypeMatrix %v2float 2
 %_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
-%58 = OpTypeFunction %bool %_ptr_Function_mat2v2float
+%66 = OpTypeFunction %bool %_ptr_Function_mat2v2float
 %mat3v3float = OpTypeMatrix %v3float 3
 %_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
-%63 = OpTypeFunction %bool %_ptr_Function_mat3v3float
+%71 = OpTypeFunction %bool %_ptr_Function_mat3v3float
 %mat4v4float = OpTypeMatrix %v4float 4
 %_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
-%68 = OpTypeFunction %bool %_ptr_Function_mat4v4float
-%_ptr_Function_float = OpTypePointer Function %float
-%72 = OpTypeFunction %bool %_ptr_Function_float
+%76 = OpTypeFunction %bool %_ptr_Function_mat4v4float
 %_ptr_Function_bool = OpTypePointer Function %bool
-%88 = OpTypeFunction %bool %_ptr_Function_bool
+%94 = OpTypeFunction %bool %_ptr_Function_bool
 %v2bool = OpTypeVector %bool 2
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-%93 = OpTypeFunction %bool %_ptr_Function_v2bool
+%99 = OpTypeFunction %bool %_ptr_Function_v2bool
 %v3bool = OpTypeVector %bool 3
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-%98 = OpTypeFunction %bool %_ptr_Function_v3bool
+%104 = OpTypeFunction %bool %_ptr_Function_v3bool
 %v4bool = OpTypeVector %bool 4
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-%103 = OpTypeFunction %bool %_ptr_Function_v4bool
+%109 = OpTypeFunction %bool %_ptr_Function_v4bool
 %int = OpTypeInt 32 1
 %_ptr_Function_int = OpTypePointer Function %int
-%108 = OpTypeFunction %bool %_ptr_Function_int
+%114 = OpTypeFunction %bool %_ptr_Function_int
 %v2int = OpTypeVector %int 2
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-%113 = OpTypeFunction %bool %_ptr_Function_v2int
+%119 = OpTypeFunction %bool %_ptr_Function_v2int
 %v3int = OpTypeVector %int 3
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-%118 = OpTypeFunction %bool %_ptr_Function_v3int
+%124 = OpTypeFunction %bool %_ptr_Function_v3int
 %v4int = OpTypeVector %int 4
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-%123 = OpTypeFunction %bool %_ptr_Function_v4int
-%127 = OpTypeFunction %v4float %_ptr_Function_v2float
+%129 = OpTypeFunction %bool %_ptr_Function_v4int
+%133 = OpTypeFunction %v4float %_ptr_Function_v2float
 %false = OpConstantFalse %bool
-%float_2 = OpConstant %float 2
-%134 = OpConstantComposite %v2float %float_2 %float_2
-%float_3 = OpConstant %float 3
-%141 = OpConstantComposite %v3float %float_3 %float_3 %float_3
-%float_4 = OpConstant %float 4
-%148 = OpConstantComposite %v4float %float_4 %float_4 %float_4 %float_4
 %float_1 = OpConstant %float 1
-%234 = OpConstantComposite %v2bool %true %true
-%240 = OpConstantComposite %v3bool %true %true %true
-%246 = OpConstantComposite %v4bool %true %true %true %true
+%float_2 = OpConstant %float 2
+%150 = OpConstantComposite %v2float %float_2 %float_2
+%float_3 = OpConstant %float 3
+%157 = OpConstantComposite %v3float %float_3 %float_3 %float_3
+%float_4 = OpConstant %float 4
+%164 = OpConstantComposite %v4float %float_4 %float_4 %float_4 %float_4
+%249 = OpConstantComposite %v2bool %true %true
+%255 = OpConstantComposite %v3bool %true %true %true
+%261 = OpConstantComposite %v4bool %true %true %true %true
 %int_1 = OpConstant %int 1
 %int_2 = OpConstant %int 2
-%259 = OpConstantComposite %v2int %int_2 %int_2
+%274 = OpConstantComposite %v2int %int_2 %int_2
 %int_3 = OpConstant %int 3
-%266 = OpConstantComposite %v3int %int_3 %int_3 %int_3
+%281 = OpConstantComposite %v3int %int_3 %int_3 %int_3
 %int_4 = OpConstant %int 4
-%273 = OpConstantComposite %v4int %int_4 %int_4 %int_4 %int_4
+%288 = OpConstantComposite %v4int %int_4 %int_4 %int_4 %int_4
 %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
 %int_0 = OpConstant %int 0
-%_entrypoint_v = OpFunction %void None %36
-%37 = OpLabel
-%41 = OpVariable %_ptr_Function_v2float Function
-OpStore %41 %40
-%43 = OpFunctionCall %v4float %main %41
-OpStore %sk_FragColor %43
+%_entrypoint_v = OpFunction %void None %38
+%39 = OpLabel
+%43 = OpVariable %_ptr_Function_v2float Function
+OpStore %43 %42
+%45 = OpFunctionCall %v4float %main %43
+OpStore %sk_FragColor %45
 OpReturn
 OpFunctionEnd
-%takes_float2_bf2 = OpFunction %bool None %44
-%45 = OpFunctionParameter %_ptr_Function_v2float
-%46 = OpLabel
+%takes_void_b = OpFunction %bool None %46
+%47 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_float3_bf3 = OpFunction %bool None %49
-%51 = OpFunctionParameter %_ptr_Function_v3float
+%takes_float_bf = OpFunction %bool None %49
+%51 = OpFunctionParameter %_ptr_Function_float
 %52 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_float4_bf4 = OpFunction %bool None %53
-%55 = OpFunctionParameter %_ptr_Function_v4float
-%56 = OpLabel
+%takes_float2_bf2 = OpFunction %bool None %53
+%54 = OpFunctionParameter %_ptr_Function_v2float
+%55 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_float2x2_bf22 = OpFunction %bool None %58
-%60 = OpFunctionParameter %_ptr_Function_mat2v2float
-%61 = OpLabel
+%takes_float3_bf3 = OpFunction %bool None %57
+%59 = OpFunctionParameter %_ptr_Function_v3float
+%60 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_float3x3_bf33 = OpFunction %bool None %63
-%65 = OpFunctionParameter %_ptr_Function_mat3v3float
-%66 = OpLabel
+%takes_float4_bf4 = OpFunction %bool None %61
+%63 = OpFunctionParameter %_ptr_Function_v4float
+%64 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_float4x4_bf44 = OpFunction %bool None %68
-%70 = OpFunctionParameter %_ptr_Function_mat4v4float
-%71 = OpLabel
+%takes_float2x2_bf22 = OpFunction %bool None %66
+%68 = OpFunctionParameter %_ptr_Function_mat2v2float
+%69 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_half_bh = OpFunction %bool None %72
-%74 = OpFunctionParameter %_ptr_Function_float
-%75 = OpLabel
+%takes_float3x3_bf33 = OpFunction %bool None %71
+%73 = OpFunctionParameter %_ptr_Function_mat3v3float
+%74 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_half2_bh2 = OpFunction %bool None %44
-%76 = OpFunctionParameter %_ptr_Function_v2float
-%77 = OpLabel
-OpReturnValue %true
-OpFunctionEnd
-%takes_half3_bh3 = OpFunction %bool None %49
-%78 = OpFunctionParameter %_ptr_Function_v3float
+%takes_float4x4_bf44 = OpFunction %bool None %76
+%78 = OpFunctionParameter %_ptr_Function_mat4v4float
 %79 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_half4_bh4 = OpFunction %bool None %53
-%80 = OpFunctionParameter %_ptr_Function_v4float
+%takes_half_bh = OpFunction %bool None %49
+%80 = OpFunctionParameter %_ptr_Function_float
 %81 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_half2x2_bh22 = OpFunction %bool None %58
-%82 = OpFunctionParameter %_ptr_Function_mat2v2float
+%takes_half2_bh2 = OpFunction %bool None %53
+%82 = OpFunctionParameter %_ptr_Function_v2float
 %83 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_half3x3_bh33 = OpFunction %bool None %63
-%84 = OpFunctionParameter %_ptr_Function_mat3v3float
+%takes_half3_bh3 = OpFunction %bool None %57
+%84 = OpFunctionParameter %_ptr_Function_v3float
 %85 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_half4x4_bh44 = OpFunction %bool None %68
-%86 = OpFunctionParameter %_ptr_Function_mat4v4float
+%takes_half4_bh4 = OpFunction %bool None %61
+%86 = OpFunctionParameter %_ptr_Function_v4float
 %87 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_bool_bb = OpFunction %bool None %88
-%90 = OpFunctionParameter %_ptr_Function_bool
+%takes_half2x2_bh22 = OpFunction %bool None %66
+%88 = OpFunctionParameter %_ptr_Function_mat2v2float
+%89 = OpLabel
+OpReturnValue %true
+OpFunctionEnd
+%takes_half3x3_bh33 = OpFunction %bool None %71
+%90 = OpFunctionParameter %_ptr_Function_mat3v3float
 %91 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_bool2_bb2 = OpFunction %bool None %93
-%95 = OpFunctionParameter %_ptr_Function_v2bool
-%96 = OpLabel
+%takes_half4x4_bh44 = OpFunction %bool None %76
+%92 = OpFunctionParameter %_ptr_Function_mat4v4float
+%93 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_bool3_bb3 = OpFunction %bool None %98
-%100 = OpFunctionParameter %_ptr_Function_v3bool
-%101 = OpLabel
+%takes_bool_bb = OpFunction %bool None %94
+%96 = OpFunctionParameter %_ptr_Function_bool
+%97 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_bool4_bb4 = OpFunction %bool None %103
-%105 = OpFunctionParameter %_ptr_Function_v4bool
-%106 = OpLabel
+%takes_bool2_bb2 = OpFunction %bool None %99
+%101 = OpFunctionParameter %_ptr_Function_v2bool
+%102 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_int_bi = OpFunction %bool None %108
-%110 = OpFunctionParameter %_ptr_Function_int
-%111 = OpLabel
+%takes_bool3_bb3 = OpFunction %bool None %104
+%106 = OpFunctionParameter %_ptr_Function_v3bool
+%107 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_int2_bi2 = OpFunction %bool None %113
-%115 = OpFunctionParameter %_ptr_Function_v2int
-%116 = OpLabel
+%takes_bool4_bb4 = OpFunction %bool None %109
+%111 = OpFunctionParameter %_ptr_Function_v4bool
+%112 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_int3_bi3 = OpFunction %bool None %118
-%120 = OpFunctionParameter %_ptr_Function_v3int
-%121 = OpLabel
+%takes_int_bi = OpFunction %bool None %114
+%116 = OpFunctionParameter %_ptr_Function_int
+%117 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%takes_int4_bi4 = OpFunction %bool None %123
-%125 = OpFunctionParameter %_ptr_Function_v4int
-%126 = OpLabel
+%takes_int2_bi2 = OpFunction %bool None %119
+%121 = OpFunctionParameter %_ptr_Function_v2int
+%122 = OpLabel
 OpReturnValue %true
 OpFunctionEnd
-%main = OpFunction %v4float None %127
-%128 = OpFunctionParameter %_ptr_Function_v2float
-%129 = OpLabel
-%135 = OpVariable %_ptr_Function_v2float Function
-%142 = OpVariable %_ptr_Function_v3float Function
-%149 = OpVariable %_ptr_Function_v4float Function
-%157 = OpVariable %_ptr_Function_mat2v2float Function
-%166 = OpVariable %_ptr_Function_mat3v3float Function
-%176 = OpVariable %_ptr_Function_mat4v4float Function
-%182 = OpVariable %_ptr_Function_float Function
-%187 = OpVariable %_ptr_Function_v2float Function
-%192 = OpVariable %_ptr_Function_v3float Function
-%197 = OpVariable %_ptr_Function_v4float Function
-%205 = OpVariable %_ptr_Function_mat2v2float Function
-%214 = OpVariable %_ptr_Function_mat3v3float Function
-%224 = OpVariable %_ptr_Function_mat4v4float Function
-%229 = OpVariable %_ptr_Function_bool Function
-%235 = OpVariable %_ptr_Function_v2bool Function
-%241 = OpVariable %_ptr_Function_v3bool Function
-%247 = OpVariable %_ptr_Function_v4bool Function
-%253 = OpVariable %_ptr_Function_int Function
-%260 = OpVariable %_ptr_Function_v2int Function
-%267 = OpVariable %_ptr_Function_v3int Function
-%274 = OpVariable %_ptr_Function_v4int Function
-%277 = OpVariable %_ptr_Function_v4float Function
-OpSelectionMerge %132 None
-OpBranchConditional %true %131 %132
-%131 = OpLabel
-OpStore %135 %134
-%136 = OpFunctionCall %bool %takes_float2_bf2 %135
-OpBranch %132
+%takes_int3_bi3 = OpFunction %bool None %124
+%126 = OpFunctionParameter %_ptr_Function_v3int
+%127 = OpLabel
+OpReturnValue %true
+OpFunctionEnd
+%takes_int4_bi4 = OpFunction %bool None %129
+%131 = OpFunctionParameter %_ptr_Function_v4int
 %132 = OpLabel
-%137 = OpPhi %bool %false %129 %136 %131
-OpSelectionMerge %139 None
-OpBranchConditional %137 %138 %139
+OpReturnValue %true
+OpFunctionEnd
+%main = OpFunction %v4float None %133
+%134 = OpFunctionParameter %_ptr_Function_v2float
+%135 = OpLabel
+%144 = OpVariable %_ptr_Function_float Function
+%151 = OpVariable %_ptr_Function_v2float Function
+%158 = OpVariable %_ptr_Function_v3float Function
+%165 = OpVariable %_ptr_Function_v4float Function
+%173 = OpVariable %_ptr_Function_mat2v2float Function
+%182 = OpVariable %_ptr_Function_mat3v3float Function
+%192 = OpVariable %_ptr_Function_mat4v4float Function
+%197 = OpVariable %_ptr_Function_float Function
+%202 = OpVariable %_ptr_Function_v2float Function
+%207 = OpVariable %_ptr_Function_v3float Function
+%212 = OpVariable %_ptr_Function_v4float Function
+%220 = OpVariable %_ptr_Function_mat2v2float Function
+%229 = OpVariable %_ptr_Function_mat3v3float Function
+%239 = OpVariable %_ptr_Function_mat4v4float Function
+%244 = OpVariable %_ptr_Function_bool Function
+%250 = OpVariable %_ptr_Function_v2bool Function
+%256 = OpVariable %_ptr_Function_v3bool Function
+%262 = OpVariable %_ptr_Function_v4bool Function
+%268 = OpVariable %_ptr_Function_int Function
+%275 = OpVariable %_ptr_Function_v2int Function
+%282 = OpVariable %_ptr_Function_v3int Function
+%289 = OpVariable %_ptr_Function_v4int Function
+%292 = OpVariable %_ptr_Function_v4float Function
+OpSelectionMerge %138 None
+OpBranchConditional %true %137 %138
+%137 = OpLabel
+%139 = OpFunctionCall %bool %takes_void_b
+OpBranch %138
 %138 = OpLabel
-OpStore %142 %141
-%143 = OpFunctionCall %bool %takes_float3_bf3 %142
-OpBranch %139
-%139 = OpLabel
-%144 = OpPhi %bool %false %132 %143 %138
-OpSelectionMerge %146 None
-OpBranchConditional %144 %145 %146
-%145 = OpLabel
-OpStore %149 %148
-%150 = OpFunctionCall %bool %takes_float4_bf4 %149
-OpBranch %146
-%146 = OpLabel
-%151 = OpPhi %bool %false %139 %150 %145
-OpSelectionMerge %153 None
-OpBranchConditional %151 %152 %153
-%152 = OpLabel
-%155 = OpCompositeConstruct %v2float %float_2 %float_0
-%156 = OpCompositeConstruct %v2float %float_0 %float_2
-%154 = OpCompositeConstruct %mat2v2float %155 %156
-OpStore %157 %154
-%158 = OpFunctionCall %bool %takes_float2x2_bf22 %157
-OpBranch %153
-%153 = OpLabel
-%159 = OpPhi %bool %false %146 %158 %152
-OpSelectionMerge %161 None
-OpBranchConditional %159 %160 %161
-%160 = OpLabel
-%163 = OpCompositeConstruct %v3float %float_3 %float_0 %float_0
-%164 = OpCompositeConstruct %v3float %float_0 %float_3 %float_0
-%165 = OpCompositeConstruct %v3float %float_0 %float_0 %float_3
-%162 = OpCompositeConstruct %mat3v3float %163 %164 %165
-OpStore %166 %162
-%167 = OpFunctionCall %bool %takes_float3x3_bf33 %166
-OpBranch %161
+%140 = OpPhi %bool %false %135 %139 %137
+OpSelectionMerge %142 None
+OpBranchConditional %140 %141 %142
+%141 = OpLabel
+OpStore %144 %float_1
+%145 = OpFunctionCall %bool %takes_float_bf %144
+OpBranch %142
+%142 = OpLabel
+%146 = OpPhi %bool %false %138 %145 %141
+OpSelectionMerge %148 None
+OpBranchConditional %146 %147 %148
+%147 = OpLabel
+OpStore %151 %150
+%152 = OpFunctionCall %bool %takes_float2_bf2 %151
+OpBranch %148
+%148 = OpLabel
+%153 = OpPhi %bool %false %142 %152 %147
+OpSelectionMerge %155 None
+OpBranchConditional %153 %154 %155
+%154 = OpLabel
+OpStore %158 %157
+%159 = OpFunctionCall %bool %takes_float3_bf3 %158
+OpBranch %155
+%155 = OpLabel
+%160 = OpPhi %bool %false %148 %159 %154
+OpSelectionMerge %162 None
+OpBranchConditional %160 %161 %162
 %161 = OpLabel
-%168 = OpPhi %bool %false %153 %167 %160
-OpSelectionMerge %170 None
-OpBranchConditional %168 %169 %170
+OpStore %165 %164
+%166 = OpFunctionCall %bool %takes_float4_bf4 %165
+OpBranch %162
+%162 = OpLabel
+%167 = OpPhi %bool %false %155 %166 %161
+OpSelectionMerge %169 None
+OpBranchConditional %167 %168 %169
+%168 = OpLabel
+%171 = OpCompositeConstruct %v2float %float_2 %float_0
+%172 = OpCompositeConstruct %v2float %float_0 %float_2
+%170 = OpCompositeConstruct %mat2v2float %171 %172
+OpStore %173 %170
+%174 = OpFunctionCall %bool %takes_float2x2_bf22 %173
+OpBranch %169
 %169 = OpLabel
-%172 = OpCompositeConstruct %v4float %float_4 %float_0 %float_0 %float_0
-%173 = OpCompositeConstruct %v4float %float_0 %float_4 %float_0 %float_0
-%174 = OpCompositeConstruct %v4float %float_0 %float_0 %float_4 %float_0
-%175 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_4
-%171 = OpCompositeConstruct %mat4v4float %172 %173 %174 %175
-OpStore %176 %171
-%177 = OpFunctionCall %bool %takes_float4x4_bf44 %176
-OpBranch %170
-%170 = OpLabel
-%178 = OpPhi %bool %false %161 %177 %169
-OpSelectionMerge %180 None
-OpBranchConditional %178 %179 %180
-%179 = OpLabel
-OpStore %182 %float_1
-%183 = OpFunctionCall %bool %takes_half_bh %182
-OpBranch %180
-%180 = OpLabel
-%184 = OpPhi %bool %false %170 %183 %179
+%175 = OpPhi %bool %false %162 %174 %168
+OpSelectionMerge %177 None
+OpBranchConditional %175 %176 %177
+%176 = OpLabel
+%179 = OpCompositeConstruct %v3float %float_3 %float_0 %float_0
+%180 = OpCompositeConstruct %v3float %float_0 %float_3 %float_0
+%181 = OpCompositeConstruct %v3float %float_0 %float_0 %float_3
+%178 = OpCompositeConstruct %mat3v3float %179 %180 %181
+OpStore %182 %178
+%183 = OpFunctionCall %bool %takes_float3x3_bf33 %182
+OpBranch %177
+%177 = OpLabel
+%184 = OpPhi %bool %false %169 %183 %176
 OpSelectionMerge %186 None
 OpBranchConditional %184 %185 %186
 %185 = OpLabel
-OpStore %187 %134
-%188 = OpFunctionCall %bool %takes_half2_bh2 %187
+%188 = OpCompositeConstruct %v4float %float_4 %float_0 %float_0 %float_0
+%189 = OpCompositeConstruct %v4float %float_0 %float_4 %float_0 %float_0
+%190 = OpCompositeConstruct %v4float %float_0 %float_0 %float_4 %float_0
+%191 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_4
+%187 = OpCompositeConstruct %mat4v4float %188 %189 %190 %191
+OpStore %192 %187
+%193 = OpFunctionCall %bool %takes_float4x4_bf44 %192
 OpBranch %186
 %186 = OpLabel
-%189 = OpPhi %bool %false %180 %188 %185
-OpSelectionMerge %191 None
-OpBranchConditional %189 %190 %191
-%190 = OpLabel
-OpStore %192 %141
-%193 = OpFunctionCall %bool %takes_half3_bh3 %192
-OpBranch %191
-%191 = OpLabel
-%194 = OpPhi %bool %false %186 %193 %190
+%194 = OpPhi %bool %false %177 %193 %185
 OpSelectionMerge %196 None
 OpBranchConditional %194 %195 %196
 %195 = OpLabel
-OpStore %197 %148
-%198 = OpFunctionCall %bool %takes_half4_bh4 %197
+OpStore %197 %float_1
+%198 = OpFunctionCall %bool %takes_half_bh %197
 OpBranch %196
 %196 = OpLabel
-%199 = OpPhi %bool %false %191 %198 %195
+%199 = OpPhi %bool %false %186 %198 %195
 OpSelectionMerge %201 None
 OpBranchConditional %199 %200 %201
 %200 = OpLabel
-%203 = OpCompositeConstruct %v2float %float_2 %float_0
-%204 = OpCompositeConstruct %v2float %float_0 %float_2
-%202 = OpCompositeConstruct %mat2v2float %203 %204
-OpStore %205 %202
-%206 = OpFunctionCall %bool %takes_half2x2_bh22 %205
+OpStore %202 %150
+%203 = OpFunctionCall %bool %takes_half2_bh2 %202
 OpBranch %201
 %201 = OpLabel
-%207 = OpPhi %bool %false %196 %206 %200
-OpSelectionMerge %209 None
-OpBranchConditional %207 %208 %209
-%208 = OpLabel
-%211 = OpCompositeConstruct %v3float %float_3 %float_0 %float_0
-%212 = OpCompositeConstruct %v3float %float_0 %float_3 %float_0
-%213 = OpCompositeConstruct %v3float %float_0 %float_0 %float_3
-%210 = OpCompositeConstruct %mat3v3float %211 %212 %213
-OpStore %214 %210
-%215 = OpFunctionCall %bool %takes_half3x3_bh33 %214
-OpBranch %209
-%209 = OpLabel
-%216 = OpPhi %bool %false %201 %215 %208
-OpSelectionMerge %218 None
-OpBranchConditional %216 %217 %218
-%217 = OpLabel
-%220 = OpCompositeConstruct %v4float %float_4 %float_0 %float_0 %float_0
-%221 = OpCompositeConstruct %v4float %float_0 %float_4 %float_0 %float_0
-%222 = OpCompositeConstruct %v4float %float_0 %float_0 %float_4 %float_0
-%223 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_4
-%219 = OpCompositeConstruct %mat4v4float %220 %221 %222 %223
-OpStore %224 %219
-%225 = OpFunctionCall %bool %takes_half4x4_bh44 %224
-OpBranch %218
-%218 = OpLabel
-%226 = OpPhi %bool %false %209 %225 %217
-OpSelectionMerge %228 None
-OpBranchConditional %226 %227 %228
-%227 = OpLabel
-OpStore %229 %true
-%230 = OpFunctionCall %bool %takes_bool_bb %229
-OpBranch %228
-%228 = OpLabel
-%231 = OpPhi %bool %false %218 %230 %227
+%204 = OpPhi %bool %false %196 %203 %200
+OpSelectionMerge %206 None
+OpBranchConditional %204 %205 %206
+%205 = OpLabel
+OpStore %207 %157
+%208 = OpFunctionCall %bool %takes_half3_bh3 %207
+OpBranch %206
+%206 = OpLabel
+%209 = OpPhi %bool %false %201 %208 %205
+OpSelectionMerge %211 None
+OpBranchConditional %209 %210 %211
+%210 = OpLabel
+OpStore %212 %164
+%213 = OpFunctionCall %bool %takes_half4_bh4 %212
+OpBranch %211
+%211 = OpLabel
+%214 = OpPhi %bool %false %206 %213 %210
+OpSelectionMerge %216 None
+OpBranchConditional %214 %215 %216
+%215 = OpLabel
+%218 = OpCompositeConstruct %v2float %float_2 %float_0
+%219 = OpCompositeConstruct %v2float %float_0 %float_2
+%217 = OpCompositeConstruct %mat2v2float %218 %219
+OpStore %220 %217
+%221 = OpFunctionCall %bool %takes_half2x2_bh22 %220
+OpBranch %216
+%216 = OpLabel
+%222 = OpPhi %bool %false %211 %221 %215
+OpSelectionMerge %224 None
+OpBranchConditional %222 %223 %224
+%223 = OpLabel
+%226 = OpCompositeConstruct %v3float %float_3 %float_0 %float_0
+%227 = OpCompositeConstruct %v3float %float_0 %float_3 %float_0
+%228 = OpCompositeConstruct %v3float %float_0 %float_0 %float_3
+%225 = OpCompositeConstruct %mat3v3float %226 %227 %228
+OpStore %229 %225
+%230 = OpFunctionCall %bool %takes_half3x3_bh33 %229
+OpBranch %224
+%224 = OpLabel
+%231 = OpPhi %bool %false %216 %230 %223
 OpSelectionMerge %233 None
 OpBranchConditional %231 %232 %233
 %232 = OpLabel
-OpStore %235 %234
-%236 = OpFunctionCall %bool %takes_bool2_bb2 %235
+%235 = OpCompositeConstruct %v4float %float_4 %float_0 %float_0 %float_0
+%236 = OpCompositeConstruct %v4float %float_0 %float_4 %float_0 %float_0
+%237 = OpCompositeConstruct %v4float %float_0 %float_0 %float_4 %float_0
+%238 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_4
+%234 = OpCompositeConstruct %mat4v4float %235 %236 %237 %238
+OpStore %239 %234
+%240 = OpFunctionCall %bool %takes_half4x4_bh44 %239
 OpBranch %233
 %233 = OpLabel
-%237 = OpPhi %bool %false %228 %236 %232
-OpSelectionMerge %239 None
-OpBranchConditional %237 %238 %239
-%238 = OpLabel
-OpStore %241 %240
-%242 = OpFunctionCall %bool %takes_bool3_bb3 %241
-OpBranch %239
-%239 = OpLabel
-%243 = OpPhi %bool %false %233 %242 %238
-OpSelectionMerge %245 None
-OpBranchConditional %243 %244 %245
-%244 = OpLabel
-OpStore %247 %246
-%248 = OpFunctionCall %bool %takes_bool4_bb4 %247
-OpBranch %245
-%245 = OpLabel
-%249 = OpPhi %bool %false %239 %248 %244
-OpSelectionMerge %251 None
-OpBranchConditional %249 %250 %251
-%250 = OpLabel
-OpStore %253 %int_1
-%254 = OpFunctionCall %bool %takes_int_bi %253
-OpBranch %251
-%251 = OpLabel
-%255 = OpPhi %bool %false %245 %254 %250
-OpSelectionMerge %257 None
-OpBranchConditional %255 %256 %257
-%256 = OpLabel
-OpStore %260 %259
-%261 = OpFunctionCall %bool %takes_int2_bi2 %260
-OpBranch %257
-%257 = OpLabel
-%262 = OpPhi %bool %false %251 %261 %256
-OpSelectionMerge %264 None
-OpBranchConditional %262 %263 %264
-%263 = OpLabel
-OpStore %267 %266
-%268 = OpFunctionCall %bool %takes_int3_bi3 %267
-OpBranch %264
-%264 = OpLabel
-%269 = OpPhi %bool %false %257 %268 %263
-OpSelectionMerge %271 None
-OpBranchConditional %269 %270 %271
-%270 = OpLabel
-OpStore %274 %273
-%275 = OpFunctionCall %bool %takes_int4_bi4 %274
-OpBranch %271
+%241 = OpPhi %bool %false %224 %240 %232
+OpSelectionMerge %243 None
+OpBranchConditional %241 %242 %243
+%242 = OpLabel
+OpStore %244 %true
+%245 = OpFunctionCall %bool %takes_bool_bb %244
+OpBranch %243
+%243 = OpLabel
+%246 = OpPhi %bool %false %233 %245 %242
+OpSelectionMerge %248 None
+OpBranchConditional %246 %247 %248
+%247 = OpLabel
+OpStore %250 %249
+%251 = OpFunctionCall %bool %takes_bool2_bb2 %250
+OpBranch %248
+%248 = OpLabel
+%252 = OpPhi %bool %false %243 %251 %247
+OpSelectionMerge %254 None
+OpBranchConditional %252 %253 %254
+%253 = OpLabel
+OpStore %256 %255
+%257 = OpFunctionCall %bool %takes_bool3_bb3 %256
+OpBranch %254
+%254 = OpLabel
+%258 = OpPhi %bool %false %248 %257 %253
+OpSelectionMerge %260 None
+OpBranchConditional %258 %259 %260
+%259 = OpLabel
+OpStore %262 %261
+%263 = OpFunctionCall %bool %takes_bool4_bb4 %262
+OpBranch %260
+%260 = OpLabel
+%264 = OpPhi %bool %false %254 %263 %259
+OpSelectionMerge %266 None
+OpBranchConditional %264 %265 %266
+%265 = OpLabel
+OpStore %268 %int_1
+%269 = OpFunctionCall %bool %takes_int_bi %268
+OpBranch %266
+%266 = OpLabel
+%270 = OpPhi %bool %false %260 %269 %265
+OpSelectionMerge %272 None
+OpBranchConditional %270 %271 %272
 %271 = OpLabel
-%276 = OpPhi %bool %false %264 %275 %270
-OpSelectionMerge %280 None
-OpBranchConditional %276 %278 %279
+OpStore %275 %274
+%276 = OpFunctionCall %bool %takes_int2_bi2 %275
+OpBranch %272
+%272 = OpLabel
+%277 = OpPhi %bool %false %266 %276 %271
+OpSelectionMerge %279 None
+OpBranchConditional %277 %278 %279
 %278 = OpLabel
-%281 = OpAccessChain %_ptr_Uniform_v4float %31 %int_0
-%284 = OpLoad %v4float %281
-OpStore %277 %284
-OpBranch %280
+OpStore %282 %281
+%283 = OpFunctionCall %bool %takes_int3_bi3 %282
+OpBranch %279
 %279 = OpLabel
-%285 = OpAccessChain %_ptr_Uniform_v4float %31 %int_1
-%286 = OpLoad %v4float %285
-OpStore %277 %286
-OpBranch %280
-%280 = OpLabel
-%287 = OpLoad %v4float %277
-OpReturnValue %287
+%284 = OpPhi %bool %false %272 %283 %278
+OpSelectionMerge %286 None
+OpBranchConditional %284 %285 %286
+%285 = OpLabel
+OpStore %289 %288
+%290 = OpFunctionCall %bool %takes_int4_bi4 %289
+OpBranch %286
+%286 = OpLabel
+%291 = OpPhi %bool %false %279 %290 %285
+OpSelectionMerge %295 None
+OpBranchConditional %291 %293 %294
+%293 = OpLabel
+%296 = OpAccessChain %_ptr_Uniform_v4float %33 %int_0
+%299 = OpLoad %v4float %296
+OpStore %292 %299
+OpBranch %295
+%294 = OpLabel
+%300 = OpAccessChain %_ptr_Uniform_v4float %33 %int_1
+%301 = OpLoad %v4float %300
+OpStore %292 %301
+OpBranch %295
+%295 = OpLabel
+%302 = OpLoad %v4float %292
+OpReturnValue %302
 OpFunctionEnd
diff --git a/tests/sksl/shared/FunctionArgTypeMatch.glsl b/tests/sksl/shared/FunctionArgTypeMatch.glsl
index 57d7408..2c0c305 100644
--- a/tests/sksl/shared/FunctionArgTypeMatch.glsl
+++ b/tests/sksl/shared/FunctionArgTypeMatch.glsl
@@ -2,6 +2,12 @@
 out vec4 sk_FragColor;
 uniform vec4 colorGreen;
 uniform vec4 colorRed;
+bool takes_void_b() {
+    return true;
+}
+bool takes_float_bf(float x) {
+    return true;
+}
 bool takes_float2_bf2(vec2 x) {
     return true;
 }
@@ -66,5 +72,5 @@
     return true;
 }
 vec4 main() {
-    return ((((((((((((((((((((true && takes_float2_bf2(vec2(2.0))) && takes_float3_bf3(vec3(3.0))) && takes_float4_bf4(vec4(4.0))) && takes_float2x2_bf22(mat2(2.0))) && takes_float3x3_bf33(mat3(3.0))) && takes_float4x4_bf44(mat4(4.0))) && takes_half_bh(1.0)) && takes_half2_bh2(vec2(2.0))) && takes_half3_bh3(vec3(3.0))) && takes_half4_bh4(vec4(4.0))) && takes_half2x2_bh22(mat2(2.0))) && takes_half3x3_bh33(mat3(3.0))) && takes_half4x4_bh44(mat4(4.0))) && takes_bool_bb(true)) && takes_bool2_bb2(bvec2(true))) && takes_bool3_bb3(bvec3(true))) && takes_bool4_bb4(bvec4(true))) && takes_int_bi(1)) && takes_int2_bi2(ivec2(2))) && takes_int3_bi3(ivec3(3))) && takes_int4_bi4(ivec4(4)) ? colorGreen : colorRed;
+    return ((((((((((((((((((((((true && takes_void_b()) && takes_float_bf(1.0)) && takes_float2_bf2(vec2(2.0))) && takes_float3_bf3(vec3(3.0))) && takes_float4_bf4(vec4(4.0))) && takes_float2x2_bf22(mat2(2.0))) && takes_float3x3_bf33(mat3(3.0))) && takes_float4x4_bf44(mat4(4.0))) && takes_half_bh(1.0)) && takes_half2_bh2(vec2(2.0))) && takes_half3_bh3(vec3(3.0))) && takes_half4_bh4(vec4(4.0))) && takes_half2x2_bh22(mat2(2.0))) && takes_half3x3_bh33(mat3(3.0))) && takes_half4x4_bh44(mat4(4.0))) && takes_bool_bb(true)) && takes_bool2_bb2(bvec2(true))) && takes_bool3_bb3(bvec3(true))) && takes_bool4_bb4(bvec4(true))) && takes_int_bi(1)) && takes_int2_bi2(ivec2(2))) && takes_int3_bi3(ivec3(3))) && takes_int4_bi4(ivec4(4)) ? colorGreen : colorRed;
 }
diff --git a/tests/sksl/shared/FunctionArgTypeMatch.metal b/tests/sksl/shared/FunctionArgTypeMatch.metal
index 4c7cba1..65dbe01 100644
--- a/tests/sksl/shared/FunctionArgTypeMatch.metal
+++ b/tests/sksl/shared/FunctionArgTypeMatch.metal
@@ -10,6 +10,12 @@
 struct Outputs {
     float4 sk_FragColor [[color(0)]];
 };
+bool takes_void_b() {
+    return true;
+}
+bool takes_float_bf(float x) {
+    return true;
+}
 bool takes_float2_bf2(float2 x) {
     return true;
 }
@@ -76,6 +82,6 @@
 fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
     Outputs _out;
     (void)_out;
-    _out.sk_FragColor = ((((((((((((((((((((true && takes_float2_bf2(float2(2.0))) && takes_float3_bf3(float3(3.0))) && takes_float4_bf4(float4(4.0))) && takes_float2x2_bf22(float2x2(2.0))) && takes_float3x3_bf33(float3x3(3.0))) && takes_float4x4_bf44(float4x4(4.0))) && takes_half_bh(1.0)) && takes_half2_bh2(float2(2.0))) && takes_half3_bh3(float3(3.0))) && takes_half4_bh4(float4(4.0))) && takes_half2x2_bh22(float2x2(2.0))) && takes_half3x3_bh33(float3x3(3.0))) && takes_half4x4_bh44(float4x4(4.0))) && takes_bool_bb(true)) && takes_bool2_bb2(bool2(true))) && takes_bool3_bb3(bool3(true))) && takes_bool4_bb4(bool4(true))) && takes_int_bi(1)) && takes_int2_bi2(int2(2))) && takes_int3_bi3(int3(3))) && takes_int4_bi4(int4(4)) ? _uniforms.colorGreen : _uniforms.colorRed;
+    _out.sk_FragColor = ((((((((((((((((((((((true && takes_void_b()) && takes_float_bf(1.0)) && takes_float2_bf2(float2(2.0))) && takes_float3_bf3(float3(3.0))) && takes_float4_bf4(float4(4.0))) && takes_float2x2_bf22(float2x2(2.0))) && takes_float3x3_bf33(float3x3(3.0))) && takes_float4x4_bf44(float4x4(4.0))) && takes_half_bh(1.0)) && takes_half2_bh2(float2(2.0))) && takes_half3_bh3(float3(3.0))) && takes_half4_bh4(float4(4.0))) && takes_half2x2_bh22(float2x2(2.0))) && takes_half3x3_bh33(float3x3(3.0))) && takes_half4x4_bh44(float4x4(4.0))) && takes_bool_bb(true)) && takes_bool2_bb2(bool2(true))) && takes_bool3_bb3(bool3(true))) && takes_bool4_bb4(bool4(true))) && takes_int_bi(1)) && takes_int2_bi2(int2(2))) && takes_int3_bi3(int3(3))) && takes_int4_bi4(int4(4)) ? _uniforms.colorGreen : _uniforms.colorRed;
     return _out;
 }