test: Generate expected output for all tests

The expected output is far from perfect, and the generated HLSL and MSL
isn't even validated yet, so may be incorrect.

However, by committing the generated output, we get clear examples of
the currently generated output of each backend. As we land fixes and
improvements to each backend, the presubmits will require us to update
the expected test output, and so code reviews will include diffs of
each backend's generated output.

Change-Id: I5c2a9e5b796d0ab75b3ec4c7f8ad00a0a2ab166f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51224
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Ben Clayton
2021-05-18 09:24:18 +00:00
committed by Commit Bot service account
parent 5858dcc313
commit d1232670ae
29 changed files with 2938 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
void foo() {
int tint_symbol[2] = {0, 0};
int implict[2] = {0, 0};
implict = tint_symbol;
}
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}

View File

@@ -0,0 +1,10 @@
#include <metal_stdlib>
using namespace metal;
void foo() {
int tint_symbol[2] = {0};
int implict[2] = {0};
implict = tint_symbol;
}

View File

@@ -0,0 +1,34 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 16
; 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 %foo "foo"
OpName %explicit "explicit"
OpName %implict "implict"
OpDecorate %_arr_int_uint_2 ArrayStride 4
%void = OpTypeVoid
%1 = OpTypeFunction %void
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_int_uint_2 = OpTypeArray %int %uint_2
%_ptr_Function__arr_int_uint_2 = OpTypePointer Function %_arr_int_uint_2
%13 = OpConstantNull %_arr_int_uint_2
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%foo = OpFunction %void None %1
%6 = OpLabel
%explicit = OpVariable %_ptr_Function__arr_int_uint_2 Function %13
%implict = OpVariable %_ptr_Function__arr_int_uint_2 Function %13
%15 = OpLoad %_arr_int_uint_2 %explicit
OpStore %implict %15
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,9 @@
type ArrayExplicitStride = [[stride(4)]] array<i32, 2>;
type ArrayImplicitStride = array<i32, 2>;
fn foo() {
var explicit : ArrayExplicitStride;
var implict : ArrayImplicitStride;
implict = explicit;
}