mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
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:
committed by
Tint LUCI CQ
parent
6330260f7d
commit
fd75bd0965
3
test/expressions/zero_init/vec3/bool.wgsl
Normal file
3
test/expressions/zero_init/vec3/bool.wgsl
Normal file
@@ -0,0 +1,3 @@
|
||||
fn f() {
|
||||
var v = vec3<bool>();
|
||||
}
|
||||
8
test/expressions/zero_init/vec3/bool.wgsl.expected.hlsl
Normal file
8
test/expressions/zero_init/vec3/bool.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,8 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f() {
|
||||
bool3 v = bool3(false, false, false);
|
||||
}
|
||||
7
test/expressions/zero_init/vec3/bool.wgsl.expected.msl
Normal file
7
test/expressions/zero_init/vec3/bool.wgsl.expected.msl
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void f() {
|
||||
bool3 v = bool3();
|
||||
}
|
||||
|
||||
28
test/expressions/zero_init/vec3/bool.wgsl.expected.spvasm
Normal file
28
test/expressions/zero_init/vec3/bool.wgsl.expected.spvasm
Normal 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
|
||||
%v3bool = OpTypeVector %bool 3
|
||||
%9 = OpConstantNull %v3bool
|
||||
%_ptr_Function_v3bool = OpTypePointer Function %v3bool
|
||||
%unused_entry_point = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %1
|
||||
%6 = OpLabel
|
||||
%v = OpVariable %_ptr_Function_v3bool Function %9
|
||||
OpStore %v %9
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
3
test/expressions/zero_init/vec3/bool.wgsl.expected.wgsl
Normal file
3
test/expressions/zero_init/vec3/bool.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,3 @@
|
||||
fn f() {
|
||||
var v = vec3<bool>();
|
||||
}
|
||||
3
test/expressions/zero_init/vec3/f32.wgsl
Normal file
3
test/expressions/zero_init/vec3/f32.wgsl
Normal file
@@ -0,0 +1,3 @@
|
||||
fn f() {
|
||||
var v = vec3<f32>();
|
||||
}
|
||||
8
test/expressions/zero_init/vec3/f32.wgsl.expected.hlsl
Normal file
8
test/expressions/zero_init/vec3/f32.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,8 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f() {
|
||||
float3 v = float3(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
7
test/expressions/zero_init/vec3/f32.wgsl.expected.msl
Normal file
7
test/expressions/zero_init/vec3/f32.wgsl.expected.msl
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void f() {
|
||||
float3 v = float3();
|
||||
}
|
||||
|
||||
28
test/expressions/zero_init/vec3/f32.wgsl.expected.spvasm
Normal file
28
test/expressions/zero_init/vec3/f32.wgsl.expected.spvasm
Normal 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
|
||||
%v3float = OpTypeVector %float 3
|
||||
%9 = OpConstantNull %v3float
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%unused_entry_point = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %1
|
||||
%6 = OpLabel
|
||||
%v = OpVariable %_ptr_Function_v3float Function %9
|
||||
OpStore %v %9
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
3
test/expressions/zero_init/vec3/f32.wgsl.expected.wgsl
Normal file
3
test/expressions/zero_init/vec3/f32.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,3 @@
|
||||
fn f() {
|
||||
var v = vec3<f32>();
|
||||
}
|
||||
3
test/expressions/zero_init/vec3/i32.wgsl
Normal file
3
test/expressions/zero_init/vec3/i32.wgsl
Normal file
@@ -0,0 +1,3 @@
|
||||
fn f() {
|
||||
var v = vec3<i32>();
|
||||
}
|
||||
8
test/expressions/zero_init/vec3/i32.wgsl.expected.hlsl
Normal file
8
test/expressions/zero_init/vec3/i32.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,8 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f() {
|
||||
int3 v = int3(0, 0, 0);
|
||||
}
|
||||
7
test/expressions/zero_init/vec3/i32.wgsl.expected.msl
Normal file
7
test/expressions/zero_init/vec3/i32.wgsl.expected.msl
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void f() {
|
||||
int3 v = int3();
|
||||
}
|
||||
|
||||
28
test/expressions/zero_init/vec3/i32.wgsl.expected.spvasm
Normal file
28
test/expressions/zero_init/vec3/i32.wgsl.expected.spvasm
Normal 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
|
||||
%v3int = OpTypeVector %int 3
|
||||
%9 = OpConstantNull %v3int
|
||||
%_ptr_Function_v3int = OpTypePointer Function %v3int
|
||||
%unused_entry_point = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %1
|
||||
%6 = OpLabel
|
||||
%v = OpVariable %_ptr_Function_v3int Function %9
|
||||
OpStore %v %9
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
3
test/expressions/zero_init/vec3/i32.wgsl.expected.wgsl
Normal file
3
test/expressions/zero_init/vec3/i32.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,3 @@
|
||||
fn f() {
|
||||
var v = vec3<i32>();
|
||||
}
|
||||
3
test/expressions/zero_init/vec3/u32.wgsl
Normal file
3
test/expressions/zero_init/vec3/u32.wgsl
Normal file
@@ -0,0 +1,3 @@
|
||||
fn f() {
|
||||
var v = vec3<u32>();
|
||||
}
|
||||
8
test/expressions/zero_init/vec3/u32.wgsl.expected.hlsl
Normal file
8
test/expressions/zero_init/vec3/u32.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,8 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void f() {
|
||||
uint3 v = uint3(0u, 0u, 0u);
|
||||
}
|
||||
7
test/expressions/zero_init/vec3/u32.wgsl.expected.msl
Normal file
7
test/expressions/zero_init/vec3/u32.wgsl.expected.msl
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void f() {
|
||||
uint3 v = uint3();
|
||||
}
|
||||
|
||||
28
test/expressions/zero_init/vec3/u32.wgsl.expected.spvasm
Normal file
28
test/expressions/zero_init/vec3/u32.wgsl.expected.spvasm
Normal 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
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%9 = OpConstantNull %v3uint
|
||||
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
|
||||
%unused_entry_point = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %1
|
||||
%6 = OpLabel
|
||||
%v = OpVariable %_ptr_Function_v3uint Function %9
|
||||
OpStore %v %9
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
3
test/expressions/zero_init/vec3/u32.wgsl.expected.wgsl
Normal file
3
test/expressions/zero_init/vec3/u32.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,3 @@
|
||||
fn f() {
|
||||
var v = vec3<u32>();
|
||||
}
|
||||
Reference in New Issue
Block a user