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 = vec2<bool>();
}

View File

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

View File

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

View File

@@ -0,0 +1,28 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 12
; 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
%v2bool = OpTypeVector %bool 2
%9 = OpConstantNull %v2bool
%_ptr_Function_v2bool = OpTypePointer Function %v2bool
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_v2bool Function %9
OpStore %v %9
OpReturn
OpFunctionEnd

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,28 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 12
; 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
%9 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_v2float Function %9
OpStore %v %9
OpReturn
OpFunctionEnd

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,28 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 12
; 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
%v2int = OpTypeVector %int 2
%9 = OpConstantNull %v2int
%_ptr_Function_v2int = OpTypePointer Function %v2int
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_v2int Function %9
OpStore %v %9
OpReturn
OpFunctionEnd

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,28 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 12
; 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
%v2uint = OpTypeVector %uint 2
%9 = OpConstantNull %v2uint
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %1
%6 = OpLabel
%v = OpVariable %_ptr_Function_v2uint Function %9
OpStore %v %9
OpReturn
OpFunctionEnd

View File

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