Update `function/return_types.wgsl` to call the methods.
Updates the `test/tint/types/functions/return_types.wgsl` test to call
the return methods. This fixes an issue where if `SingleEntryPoint` is
run the functions being testing will all be stripped.
Bug: 364029038
Change-Id: Ie81977c46f4ab95e9b7ca4d5c8b5332feba66dd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/205255
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/test/tint/types/functions/return_types.wgsl b/test/tint/types/functions/return_types.wgsl
index 06a055e..c0c3b35 100644
--- a/test/tint/types/functions/return_types.wgsl
+++ b/test/tint/types/functions/return_types.wgsl
@@ -15,4 +15,14 @@
@compute @workgroup_size(1)
fn main() {
+ let a = ret_bool();
+ let b = ret_i32();
+ let c = ret_u32();
+ let d = ret_f32();
+ let e = ret_v2i32();
+ let f = ret_v3u32();
+ let g = ret_v4f32();
+ let h = ret_m2x3();
+ let i = ret_arr();
+ let j = ret_struct();
}
diff --git a/test/tint/types/functions/return_types.wgsl.expected.dxc.hlsl b/test/tint/types/functions/return_types.wgsl.expected.dxc.hlsl
index 8410487..7e6f869 100644
--- a/test/tint/types/functions/return_types.wgsl.expected.dxc.hlsl
+++ b/test/tint/types/functions/return_types.wgsl.expected.dxc.hlsl
@@ -47,5 +47,15 @@
[numthreads(1, 1, 1)]
void main() {
+ bool a = ret_bool();
+ int b = ret_i32();
+ uint c = ret_u32();
+ float d = ret_f32();
+ int2 e = ret_v2i32();
+ uint3 f = ret_v3u32();
+ float4 g = ret_v4f32();
+ float2x3 h = ret_m2x3();
+ float i[4] = ret_arr();
+ S j = ret_struct();
return;
}
diff --git a/test/tint/types/functions/return_types.wgsl.expected.fxc.hlsl b/test/tint/types/functions/return_types.wgsl.expected.fxc.hlsl
index 8410487..7e6f869 100644
--- a/test/tint/types/functions/return_types.wgsl.expected.fxc.hlsl
+++ b/test/tint/types/functions/return_types.wgsl.expected.fxc.hlsl
@@ -47,5 +47,15 @@
[numthreads(1, 1, 1)]
void main() {
+ bool a = ret_bool();
+ int b = ret_i32();
+ uint c = ret_u32();
+ float d = ret_f32();
+ int2 e = ret_v2i32();
+ uint3 f = ret_v3u32();
+ float4 g = ret_v4f32();
+ float2x3 h = ret_m2x3();
+ float i[4] = ret_arr();
+ S j = ret_struct();
return;
}
diff --git a/test/tint/types/functions/return_types.wgsl.expected.glsl b/test/tint/types/functions/return_types.wgsl.expected.glsl
index 966cd2a..ceb5d03 100644
--- a/test/tint/types/functions/return_types.wgsl.expected.glsl
+++ b/test/tint/types/functions/return_types.wgsl.expected.glsl
@@ -4,7 +4,59 @@
float a;
};
+bool ret_bool() {
+ return false;
+}
+
+int ret_i32() {
+ return 0;
+}
+
+uint ret_u32() {
+ return 0u;
+}
+
+float ret_f32() {
+ return 0.0f;
+}
+
+ivec2 ret_v2i32() {
+ return ivec2(0);
+}
+
+uvec3 ret_v3u32() {
+ return uvec3(0u);
+}
+
+vec4 ret_v4f32() {
+ return vec4(0.0f);
+}
+
+mat2x3 ret_m2x3() {
+ return mat2x3(vec3(0.0f), vec3(0.0f));
+}
+
+float[4] ret_arr() {
+ float tint_symbol_1[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
+ return tint_symbol_1;
+}
+
+S ret_struct() {
+ S tint_symbol_2 = S(0.0f);
+ return tint_symbol_2;
+}
+
void tint_symbol() {
+ bool a = ret_bool();
+ int b = ret_i32();
+ uint c = ret_u32();
+ float d = ret_f32();
+ ivec2 e = ret_v2i32();
+ uvec3 f = ret_v3u32();
+ vec4 g = ret_v4f32();
+ mat2x3 h = ret_m2x3();
+ float i[4] = ret_arr();
+ S j = ret_struct();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
diff --git a/test/tint/types/functions/return_types.wgsl.expected.ir.dxc.hlsl b/test/tint/types/functions/return_types.wgsl.expected.ir.dxc.hlsl
index 43cd472..313c5eb 100644
--- a/test/tint/types/functions/return_types.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/types/functions/return_types.wgsl.expected.ir.dxc.hlsl
@@ -48,5 +48,15 @@
[numthreads(1, 1, 1)]
void main() {
+ bool a = ret_bool();
+ int b = ret_i32();
+ uint c = ret_u32();
+ float d = ret_f32();
+ int2 e = ret_v2i32();
+ uint3 f = ret_v3u32();
+ float4 g = ret_v4f32();
+ float2x3 h = ret_m2x3();
+ float i[4] = ret_arr();
+ S j = ret_struct();
}
diff --git a/test/tint/types/functions/return_types.wgsl.expected.ir.fxc.hlsl b/test/tint/types/functions/return_types.wgsl.expected.ir.fxc.hlsl
index 43cd472..313c5eb 100644
--- a/test/tint/types/functions/return_types.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/types/functions/return_types.wgsl.expected.ir.fxc.hlsl
@@ -48,5 +48,15 @@
[numthreads(1, 1, 1)]
void main() {
+ bool a = ret_bool();
+ int b = ret_i32();
+ uint c = ret_u32();
+ float d = ret_f32();
+ int2 e = ret_v2i32();
+ uint3 f = ret_v3u32();
+ float4 g = ret_v4f32();
+ float2x3 h = ret_m2x3();
+ float i[4] = ret_arr();
+ S j = ret_struct();
}
diff --git a/test/tint/types/functions/return_types.wgsl.expected.ir.glsl b/test/tint/types/functions/return_types.wgsl.expected.ir.glsl
index f83bcf2..10175a7 100644
--- a/test/tint/types/functions/return_types.wgsl.expected.ir.glsl
+++ b/test/tint/types/functions/return_types.wgsl.expected.ir.glsl
@@ -1,5 +1,49 @@
#version 310 es
+struct S {
+ float a;
+};
+
+bool ret_bool() {
+ return false;
+}
+int ret_i32() {
+ return 0;
+}
+uint ret_u32() {
+ return 0u;
+}
+float ret_f32() {
+ return 0.0f;
+}
+ivec2 ret_v2i32() {
+ return ivec2(0);
+}
+uvec3 ret_v3u32() {
+ return uvec3(0u);
+}
+vec4 ret_v4f32() {
+ return vec4(0.0f);
+}
+mat2x3 ret_m2x3() {
+ return mat2x3(vec3(0.0f), vec3(0.0f));
+}
+float[4] ret_arr() {
+ return float[4](0.0f, 0.0f, 0.0f, 0.0f);
+}
+S ret_struct() {
+ return S(0.0f);
+}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
+ bool a = ret_bool();
+ int b = ret_i32();
+ uint c = ret_u32();
+ float d = ret_f32();
+ ivec2 e = ret_v2i32();
+ uvec3 f = ret_v3u32();
+ vec4 g = ret_v4f32();
+ mat2x3 h = ret_m2x3();
+ float i[4] = ret_arr();
+ S j = ret_struct();
}
diff --git a/test/tint/types/functions/return_types.wgsl.expected.ir.msl b/test/tint/types/functions/return_types.wgsl.expected.ir.msl
index 600eb73..3824328 100644
--- a/test/tint/types/functions/return_types.wgsl.expected.ir.msl
+++ b/test/tint/types/functions/return_types.wgsl.expected.ir.msl
@@ -58,4 +58,14 @@
}
kernel void tint_symbol() {
+ bool const a = ret_bool();
+ int const b = ret_i32();
+ uint const c = ret_u32();
+ float const d = ret_f32();
+ int2 const e = ret_v2i32();
+ uint3 const f = ret_v3u32();
+ float4 const g = ret_v4f32();
+ float2x3 const h = ret_m2x3();
+ tint_array<float, 4> const i = ret_arr();
+ S const j = ret_struct();
}
diff --git a/test/tint/types/functions/return_types.wgsl.expected.msl b/test/tint/types/functions/return_types.wgsl.expected.msl
index 2f9822c..ab19876 100644
--- a/test/tint/types/functions/return_types.wgsl.expected.msl
+++ b/test/tint/types/functions/return_types.wgsl.expected.msl
@@ -61,6 +61,16 @@
}
kernel void tint_symbol() {
+ bool const a = ret_bool();
+ int const b = ret_i32();
+ uint const c = ret_u32();
+ float const d = ret_f32();
+ int2 const e = ret_v2i32();
+ uint3 const f = ret_v3u32();
+ float4 const g = ret_v4f32();
+ float2x3 const h = ret_m2x3();
+ tint_array<float, 4> const i = ret_arr();
+ S const j = ret_struct();
return;
}
diff --git a/test/tint/types/functions/return_types.wgsl.expected.spvasm b/test/tint/types/functions/return_types.wgsl.expected.spvasm
index ffdbb4f..4814a6a 100644
--- a/test/tint/types/functions/return_types.wgsl.expected.spvasm
+++ b/test/tint/types/functions/return_types.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
-; Bound: 57
+; Bound: 67
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -20,6 +20,16 @@
OpMemberName %S 0 "a"
OpName %S "S"
OpName %main "main"
+ OpName %a "a"
+ OpName %b "b"
+ OpName %c "c"
+ OpName %d "d"
+ OpName %e "e"
+ OpName %f "f"
+ OpName %g "g"
+ OpName %h "h"
+ OpName %i "i"
+ OpName %j "j"
OpDecorate %_arr_float_uint_4 ArrayStride 4
OpMemberDecorate %S 0 Offset 0
%bool = OpTypeBool
@@ -98,5 +108,15 @@
OpFunctionEnd
%main = OpFunction %void None %55
%56 = OpLabel
+ %a = OpFunctionCall %bool %ret_bool
+ %b = OpFunctionCall %int %ret_i32
+ %c = OpFunctionCall %uint %ret_u32
+ %d = OpFunctionCall %float %ret_f32
+ %e = OpFunctionCall %v2int %ret_v2i32
+ %f = OpFunctionCall %v3uint %ret_v3u32
+ %g = OpFunctionCall %v4float %ret_v4f32
+ %h = OpFunctionCall %mat2v3float %ret_m2x3
+ %i = OpFunctionCall %_arr_float_uint_4 %ret_arr
+ %j = OpFunctionCall %S %ret_struct
OpReturn
OpFunctionEnd
diff --git a/test/tint/types/functions/return_types.wgsl.expected.wgsl b/test/tint/types/functions/return_types.wgsl.expected.wgsl
index d339d33..c81e814 100644
--- a/test/tint/types/functions/return_types.wgsl.expected.wgsl
+++ b/test/tint/types/functions/return_types.wgsl.expected.wgsl
@@ -44,4 +44,14 @@
@compute @workgroup_size(1)
fn main() {
+ let a = ret_bool();
+ let b = ret_i32();
+ let c = ret_u32();
+ let d = ret_f32();
+ let e = ret_v2i32();
+ let f = ret_v3u32();
+ let g = ret_v4f32();
+ let h = ret_m2x3();
+ let i = ret_arr();
+ let j = ret_struct();
}