test: Add test cases for zero value constructors

Fixed: tint:477
Change-Id: I087c24904ab2f38524ab2c39092fbfb277fdba3b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55256
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2021-06-21 20:31:36 +00:00 committed by Tint LUCI CQ
parent 6330260f7d
commit fd75bd0965
160 changed files with 1734 additions and 0 deletions

View File

@ -0,0 +1,3 @@
fn f() {
var v = array<bool, 4>();
}

View File

@ -0,0 +1,12 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
struct tint_array_wrapper {
bool arr[4];
};
void f() {
tint_array_wrapper v = {{false, false, false, false}};
}

View File

@ -0,0 +1,11 @@
#include <metal_stdlib>
using namespace metal;
struct tint_array_wrapper {
bool arr[4];
};
void f() {
tint_array_wrapper v = {.arr={}};
}

View File

@ -0,0 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 14
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_bool_uint_4 ArrayStride 4
%void = OpTypeVoid
%1 = OpTypeFunction %void
%bool = OpTypeBool
%uint = OpTypeInt 32 0
%uint_4 = OpConstant %uint 4
%_arr_bool_uint_4 = OpTypeArray %bool %uint_4
%11 = OpConstantNull %_arr_bool_uint_4
%_ptr_Function__arr_bool_uint_4 = OpTypePointer Function %_arr_bool_uint_4
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function__arr_bool_uint_4 Function %11
OpStore %v %11
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = array<bool, 4>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = array<f32, 4>();
}

View File

@ -0,0 +1,12 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
struct tint_array_wrapper {
float arr[4];
};
void f() {
tint_array_wrapper v = {{0.0f, 0.0f, 0.0f, 0.0f}};
}

View File

@ -0,0 +1,11 @@
#include <metal_stdlib>
using namespace metal;
struct tint_array_wrapper {
float arr[4];
};
void f() {
tint_array_wrapper v = {.arr={}};
}

View File

@ -0,0 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 14
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_float_uint_4 ArrayStride 4
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%uint_4 = OpConstant %uint 4
%_arr_float_uint_4 = OpTypeArray %float %uint_4
%11 = OpConstantNull %_arr_float_uint_4
%_ptr_Function__arr_float_uint_4 = OpTypePointer Function %_arr_float_uint_4
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function__arr_float_uint_4 Function %11
OpStore %v %11
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = array<f32, 4>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = array<i32, 4>();
}

View File

@ -0,0 +1,12 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
struct tint_array_wrapper {
int arr[4];
};
void f() {
tint_array_wrapper v = {{0, 0, 0, 0}};
}

View File

@ -0,0 +1,11 @@
#include <metal_stdlib>
using namespace metal;
struct tint_array_wrapper {
int arr[4];
};
void f() {
tint_array_wrapper v = {.arr={}};
}

View File

@ -0,0 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 14
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_int_uint_4 ArrayStride 4
%void = OpTypeVoid
%1 = OpTypeFunction %void
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%uint_4 = OpConstant %uint 4
%_arr_int_uint_4 = OpTypeArray %int %uint_4
%11 = OpConstantNull %_arr_int_uint_4
%_ptr_Function__arr_int_uint_4 = OpTypePointer Function %_arr_int_uint_4
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function__arr_int_uint_4 Function %11
OpStore %v %11
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = array<i32, 4>();
}

View File

@ -0,0 +1,10 @@
struct S {
i : i32;
u : u32;
f : f32;
b : bool;
};
fn f() {
var v = array<S, 4>();
}

View File

@ -0,0 +1,18 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
struct S {
int i;
uint u;
float f;
bool b;
};
struct tint_array_wrapper {
S arr[4];
};
void f() {
tint_array_wrapper v = {{{0, 0u, 0.0f, false}, {0, 0u, 0.0f, false}, {0, 0u, 0.0f, false}, {0, 0u, 0.0f, false}}};
}

View File

@ -0,0 +1,17 @@
#include <metal_stdlib>
using namespace metal;
struct S {
int i;
uint u;
float f;
bool b;
};
struct tint_array_wrapper {
S arr[4];
};
void f() {
tint_array_wrapper v = {.arr={}};
}

View File

@ -0,0 +1,43 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 17
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %S "S"
OpMemberName %S 0 "i"
OpMemberName %S 1 "u"
OpMemberName %S 2 "f"
OpMemberName %S 3 "b"
OpName %v "v"
OpMemberDecorate %S 0 Offset 0
OpMemberDecorate %S 1 Offset 4
OpMemberDecorate %S 2 Offset 8
OpMemberDecorate %S 3 Offset 12
OpDecorate %_arr_S_uint_4 ArrayStride 16
%void = OpTypeVoid
%1 = OpTypeFunction %void
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%float = OpTypeFloat 32
%bool = OpTypeBool
%S = OpTypeStruct %int %uint %float %bool
%uint_4 = OpConstant %uint 4
%_arr_S_uint_4 = OpTypeArray %S %uint_4
%14 = OpConstantNull %_arr_S_uint_4
%_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function__arr_S_uint_4 Function %14
OpStore %v %14
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,10 @@
struct S {
i : i32;
u : u32;
f : f32;
b : bool;
};
fn f() {
var v = array<S, 4>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = array<u32, 4>();
}

View File

@ -0,0 +1,12 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
struct tint_array_wrapper {
uint arr[4];
};
void f() {
tint_array_wrapper v = {{0u, 0u, 0u, 0u}};
}

View File

@ -0,0 +1,11 @@
#include <metal_stdlib>
using namespace metal;
struct tint_array_wrapper {
uint arr[4];
};
void f() {
tint_array_wrapper v = {.arr={}};
}

View File

@ -0,0 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 13
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_uint_uint_4 ArrayStride 4
%void = OpTypeVoid
%1 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_4 = OpConstant %uint 4
%_arr_uint_uint_4 = OpTypeArray %uint %uint_4
%10 = OpConstantNull %_arr_uint_uint_4
%_ptr_Function__arr_uint_uint_4 = OpTypePointer Function %_arr_uint_uint_4
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function__arr_uint_uint_4 Function %10
OpStore %v %10
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = array<u32, 4>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat2x2<f32>();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
float2x2 v = float2x2(0.0f, 0.0f, 0.0f, 0.0f);
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
float2x2 v = float2x2();
}

View File

@ -0,0 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 13
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%mat2v2float = OpTypeMatrix %v2float 2
%10 = OpConstantNull %mat2v2float
%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_mat2v2float Function %10
OpStore %v %10
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat2x2<f32>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat2x3<f32>();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
float2x3 v = float2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
float2x3 v = float2x3();
}

View File

@ -0,0 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 13
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%v3float = OpTypeVector %float 3
%mat2v3float = OpTypeMatrix %v3float 2
%10 = OpConstantNull %mat2v3float
%_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_mat2v3float Function %10
OpStore %v %10
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat2x3<f32>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat2x4<f32>();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
float2x4 v = float2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
float2x4 v = float2x4();
}

View File

@ -0,0 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 13
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%mat2v4float = OpTypeMatrix %v4float 2
%10 = OpConstantNull %mat2v4float
%_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_mat2v4float Function %10
OpStore %v %10
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat2x4<f32>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat3x2<f32>();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
float3x2 v = float3x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
float3x2 v = float3x2();
}

View File

@ -0,0 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 13
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%mat3v2float = OpTypeMatrix %v2float 3
%10 = OpConstantNull %mat3v2float
%_ptr_Function_mat3v2float = OpTypePointer Function %mat3v2float
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_mat3v2float Function %10
OpStore %v %10
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat3x2<f32>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat3x3<f32>();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
float3x3 v = float3x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
float3x3 v = float3x3();
}

View File

@ -0,0 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 13
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3
%10 = OpConstantNull %mat3v3float
%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_mat3v3float Function %10
OpStore %v %10
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat3x3<f32>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat3x4<f32>();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
float3x4 v = float3x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
float3x4 v = float3x4();
}

View File

@ -0,0 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 13
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%mat3v4float = OpTypeMatrix %v4float 3
%10 = OpConstantNull %mat3v4float
%_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_mat3v4float Function %10
OpStore %v %10
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat3x4<f32>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat4x2<f32>();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
float4x2 v = float4x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
float4x2 v = float4x2();
}

View File

@ -0,0 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 13
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%mat4v2float = OpTypeMatrix %v2float 4
%10 = OpConstantNull %mat4v2float
%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_mat4v2float Function %10
OpStore %v %10
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat4x2<f32>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat4x3<f32>();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
float4x3 v = float4x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
float4x3 v = float4x3();
}

View File

@ -0,0 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 13
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%v3float = OpTypeVector %float 3
%mat4v3float = OpTypeMatrix %v3float 4
%10 = OpConstantNull %mat4v3float
%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_mat4v3float Function %10
OpStore %v %10
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat4x3<f32>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat4x4<f32>();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
float4x4 v = float4x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
float4x4 v = float4x4();
}

View File

@ -0,0 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 13
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%mat4v4float = OpTypeMatrix %v4float 4
%10 = OpConstantNull %mat4v4float
%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_mat4v4float Function %10
OpStore %v %10
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = mat4x4<f32>();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = bool();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
bool v = false;
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
bool v = bool();
}

View File

@ -0,0 +1,27 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 11
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%bool = OpTypeBool
%8 = OpConstantNull %bool
%_ptr_Function_bool = OpTypePointer Function %bool
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_bool Function %8
OpStore %v %8
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = bool();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = f32();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
float v = 0.0f;
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
float v = float();
}

View File

@ -0,0 +1,27 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 11
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%8 = OpConstantNull %float
%_ptr_Function_float = OpTypePointer Function %float
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_float Function %8
OpStore %v %8
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = f32();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = i32();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
int v = 0;
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
int v = int();
}

View File

@ -0,0 +1,27 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 11
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%int = OpTypeInt 32 1
%8 = OpConstantNull %int
%_ptr_Function_int = OpTypePointer Function %int
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_int Function %8
OpStore %v %8
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = i32();
}

View File

@ -0,0 +1,3 @@
fn f() {
var v = u32();
}

View File

@ -0,0 +1,8 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void f() {
uint v = 0u;
}

View File

@ -0,0 +1,7 @@
#include <metal_stdlib>
using namespace metal;
void f() {
uint v = uint();
}

View File

@ -0,0 +1,27 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 11
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%8 = OpConstantNull %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_uint Function %8
OpStore %v %8
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,3 @@
fn f() {
var v = u32();
}

View File

@ -0,0 +1,7 @@
struct S {
a : array<f32, 4>;
};
fn f() {
var v = S();
}

View File

@ -0,0 +1,15 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
struct tint_array_wrapper {
float arr[4];
};
struct S {
tint_array_wrapper a;
};
void f() {
S v = {{{0.0f, 0.0f, 0.0f, 0.0f}}};
}

View File

@ -0,0 +1,14 @@
#include <metal_stdlib>
using namespace metal;
struct tint_array_wrapper {
float arr[4];
};
struct S {
tint_array_wrapper a;
};
void f() {
S v = {};
}

View File

@ -0,0 +1,35 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 15
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %S "S"
OpMemberName %S 0 "a"
OpName %v "v"
OpMemberDecorate %S 0 Offset 0
OpDecorate %_arr_float_uint_4 ArrayStride 4
%void = OpTypeVoid
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%uint_4 = OpConstant %uint 4
%_arr_float_uint_4 = OpTypeArray %float %uint_4
%S = OpTypeStruct %_arr_float_uint_4
%12 = OpConstantNull %S
%_ptr_Function_S = OpTypePointer Function %S
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_S Function %12
OpStore %v %12
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,7 @@
struct S {
a : array<f32, 4>;
};
fn f() {
var v = S();
}

View File

@ -0,0 +1,10 @@
struct S {
i : i32;
u : u32;
f : f32;
b : bool;
};
fn f() {
var v = S();
}

View File

@ -0,0 +1,15 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
struct S {
int i;
uint u;
float f;
bool b;
};
void f() {
S v = {0, 0u, 0.0f, false};
}

View File

@ -0,0 +1,14 @@
#include <metal_stdlib>
using namespace metal;
struct S {
int i;
uint u;
float f;
bool b;
};
void f() {
S v = {};
}

View File

@ -0,0 +1,40 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 15
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %S "S"
OpMemberName %S 0 "i"
OpMemberName %S 1 "u"
OpMemberName %S 2 "f"
OpMemberName %S 3 "b"
OpName %v "v"
OpMemberDecorate %S 0 Offset 0
OpMemberDecorate %S 1 Offset 4
OpMemberDecorate %S 2 Offset 8
OpMemberDecorate %S 3 Offset 12
%void = OpTypeVoid
%1 = OpTypeFunction %void
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%float = OpTypeFloat 32
%bool = OpTypeBool
%S = OpTypeStruct %int %uint %float %bool
%12 = OpConstantNull %S
%_ptr_Function_S = OpTypePointer Function %S
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_S Function %12
OpStore %v %12
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,10 @@
struct S {
i : i32;
u : u32;
f : f32;
b : bool;
};
fn f() {
var v = S();
}

Some files were not shown because too many files have changed in this diff Show More