From fd75bd0965020ead514ce25caf946974bf50d06e Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Mon, 21 Jun 2021 20:31:36 +0000 Subject: [PATCH] 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 Kokoro: Kokoro Reviewed-by: Antonio Maiorano Commit-Queue: Ben Clayton --- test/expressions/zero_init/array/bool.wgsl | 3 ++ .../zero_init/array/bool.wgsl.expected.hlsl | 12 ++++++ .../zero_init/array/bool.wgsl.expected.msl | 11 +++++ .../zero_init/array/bool.wgsl.expected.spvasm | 31 +++++++++++++ .../zero_init/array/bool.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/array/f32.wgsl | 3 ++ .../zero_init/array/f32.wgsl.expected.hlsl | 12 ++++++ .../zero_init/array/f32.wgsl.expected.msl | 11 +++++ .../zero_init/array/f32.wgsl.expected.spvasm | 31 +++++++++++++ .../zero_init/array/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/array/i32.wgsl | 3 ++ .../zero_init/array/i32.wgsl.expected.hlsl | 12 ++++++ .../zero_init/array/i32.wgsl.expected.msl | 11 +++++ .../zero_init/array/i32.wgsl.expected.spvasm | 31 +++++++++++++ .../zero_init/array/i32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/array/struct.wgsl | 10 +++++ .../zero_init/array/struct.wgsl.expected.hlsl | 18 ++++++++ .../zero_init/array/struct.wgsl.expected.msl | 17 ++++++++ .../array/struct.wgsl.expected.spvasm | 43 +++++++++++++++++++ .../zero_init/array/struct.wgsl.expected.wgsl | 10 +++++ test/expressions/zero_init/array/u32.wgsl | 3 ++ .../zero_init/array/u32.wgsl.expected.hlsl | 12 ++++++ .../zero_init/array/u32.wgsl.expected.msl | 11 +++++ .../zero_init/array/u32.wgsl.expected.spvasm | 30 +++++++++++++ .../zero_init/array/u32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/mat2x2/f32.wgsl | 3 ++ .../zero_init/mat2x2/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/mat2x2/f32.wgsl.expected.msl | 7 +++ .../zero_init/mat2x2/f32.wgsl.expected.spvasm | 29 +++++++++++++ .../zero_init/mat2x2/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/mat2x3/f32.wgsl | 3 ++ .../zero_init/mat2x3/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/mat2x3/f32.wgsl.expected.msl | 7 +++ .../zero_init/mat2x3/f32.wgsl.expected.spvasm | 29 +++++++++++++ .../zero_init/mat2x3/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/mat2x4/f32.wgsl | 3 ++ .../zero_init/mat2x4/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/mat2x4/f32.wgsl.expected.msl | 7 +++ .../zero_init/mat2x4/f32.wgsl.expected.spvasm | 29 +++++++++++++ .../zero_init/mat2x4/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/mat3x2/f32.wgsl | 3 ++ .../zero_init/mat3x2/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/mat3x2/f32.wgsl.expected.msl | 7 +++ .../zero_init/mat3x2/f32.wgsl.expected.spvasm | 29 +++++++++++++ .../zero_init/mat3x2/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/mat3x3/f32.wgsl | 3 ++ .../zero_init/mat3x3/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/mat3x3/f32.wgsl.expected.msl | 7 +++ .../zero_init/mat3x3/f32.wgsl.expected.spvasm | 29 +++++++++++++ .../zero_init/mat3x3/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/mat3x4/f32.wgsl | 3 ++ .../zero_init/mat3x4/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/mat3x4/f32.wgsl.expected.msl | 7 +++ .../zero_init/mat3x4/f32.wgsl.expected.spvasm | 29 +++++++++++++ .../zero_init/mat3x4/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/mat4x2/f32.wgsl | 3 ++ .../zero_init/mat4x2/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/mat4x2/f32.wgsl.expected.msl | 7 +++ .../zero_init/mat4x2/f32.wgsl.expected.spvasm | 29 +++++++++++++ .../zero_init/mat4x2/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/mat4x3/f32.wgsl | 3 ++ .../zero_init/mat4x3/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/mat4x3/f32.wgsl.expected.msl | 7 +++ .../zero_init/mat4x3/f32.wgsl.expected.spvasm | 29 +++++++++++++ .../zero_init/mat4x3/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/mat4x4/f32.wgsl | 3 ++ .../zero_init/mat4x4/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/mat4x4/f32.wgsl.expected.msl | 7 +++ .../zero_init/mat4x4/f32.wgsl.expected.spvasm | 29 +++++++++++++ .../zero_init/mat4x4/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/scalar/bool.wgsl | 3 ++ .../zero_init/scalar/bool.wgsl.expected.hlsl | 8 ++++ .../zero_init/scalar/bool.wgsl.expected.msl | 7 +++ .../scalar/bool.wgsl.expected.spvasm | 27 ++++++++++++ .../zero_init/scalar/bool.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/scalar/f32.wgsl | 3 ++ .../zero_init/scalar/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/scalar/f32.wgsl.expected.msl | 7 +++ .../zero_init/scalar/f32.wgsl.expected.spvasm | 27 ++++++++++++ .../zero_init/scalar/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/scalar/i32.wgsl | 3 ++ .../zero_init/scalar/i32.wgsl.expected.hlsl | 8 ++++ .../zero_init/scalar/i32.wgsl.expected.msl | 7 +++ .../zero_init/scalar/i32.wgsl.expected.spvasm | 27 ++++++++++++ .../zero_init/scalar/i32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/scalar/u32.wgsl | 3 ++ .../zero_init/scalar/u32.wgsl.expected.hlsl | 8 ++++ .../zero_init/scalar/u32.wgsl.expected.msl | 7 +++ .../zero_init/scalar/u32.wgsl.expected.spvasm | 27 ++++++++++++ .../zero_init/scalar/u32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/struct/array.wgsl | 7 +++ .../zero_init/struct/array.wgsl.expected.hlsl | 15 +++++++ .../zero_init/struct/array.wgsl.expected.msl | 14 ++++++ .../struct/array.wgsl.expected.spvasm | 35 +++++++++++++++ .../zero_init/struct/array.wgsl.expected.wgsl | 7 +++ test/expressions/zero_init/struct/scalar.wgsl | 10 +++++ .../struct/scalar.wgsl.expected.hlsl | 15 +++++++ .../zero_init/struct/scalar.wgsl.expected.msl | 14 ++++++ .../struct/scalar.wgsl.expected.spvasm | 40 +++++++++++++++++ .../struct/scalar.wgsl.expected.wgsl | 10 +++++ test/expressions/zero_init/vec2/bool.wgsl | 3 ++ .../zero_init/vec2/bool.wgsl.expected.hlsl | 8 ++++ .../zero_init/vec2/bool.wgsl.expected.msl | 7 +++ .../zero_init/vec2/bool.wgsl.expected.spvasm | 28 ++++++++++++ .../zero_init/vec2/bool.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/vec2/f32.wgsl | 3 ++ .../zero_init/vec2/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/vec2/f32.wgsl.expected.msl | 7 +++ .../zero_init/vec2/f32.wgsl.expected.spvasm | 28 ++++++++++++ .../zero_init/vec2/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/vec2/i32.wgsl | 3 ++ .../zero_init/vec2/i32.wgsl.expected.hlsl | 8 ++++ .../zero_init/vec2/i32.wgsl.expected.msl | 7 +++ .../zero_init/vec2/i32.wgsl.expected.spvasm | 28 ++++++++++++ .../zero_init/vec2/i32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/vec2/u32.wgsl | 3 ++ .../zero_init/vec2/u32.wgsl.expected.hlsl | 8 ++++ .../zero_init/vec2/u32.wgsl.expected.msl | 7 +++ .../zero_init/vec2/u32.wgsl.expected.spvasm | 28 ++++++++++++ .../zero_init/vec2/u32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/vec3/bool.wgsl | 3 ++ .../zero_init/vec3/bool.wgsl.expected.hlsl | 8 ++++ .../zero_init/vec3/bool.wgsl.expected.msl | 7 +++ .../zero_init/vec3/bool.wgsl.expected.spvasm | 28 ++++++++++++ .../zero_init/vec3/bool.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/vec3/f32.wgsl | 3 ++ .../zero_init/vec3/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/vec3/f32.wgsl.expected.msl | 7 +++ .../zero_init/vec3/f32.wgsl.expected.spvasm | 28 ++++++++++++ .../zero_init/vec3/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/vec3/i32.wgsl | 3 ++ .../zero_init/vec3/i32.wgsl.expected.hlsl | 8 ++++ .../zero_init/vec3/i32.wgsl.expected.msl | 7 +++ .../zero_init/vec3/i32.wgsl.expected.spvasm | 28 ++++++++++++ .../zero_init/vec3/i32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/vec3/u32.wgsl | 3 ++ .../zero_init/vec3/u32.wgsl.expected.hlsl | 8 ++++ .../zero_init/vec3/u32.wgsl.expected.msl | 7 +++ .../zero_init/vec3/u32.wgsl.expected.spvasm | 28 ++++++++++++ .../zero_init/vec3/u32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/vec4/bool.wgsl | 3 ++ .../zero_init/vec4/bool.wgsl.expected.hlsl | 8 ++++ .../zero_init/vec4/bool.wgsl.expected.msl | 7 +++ .../zero_init/vec4/bool.wgsl.expected.spvasm | 28 ++++++++++++ .../zero_init/vec4/bool.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/vec4/f32.wgsl | 3 ++ .../zero_init/vec4/f32.wgsl.expected.hlsl | 8 ++++ .../zero_init/vec4/f32.wgsl.expected.msl | 7 +++ .../zero_init/vec4/f32.wgsl.expected.spvasm | 28 ++++++++++++ .../zero_init/vec4/f32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/vec4/i32.wgsl | 3 ++ .../zero_init/vec4/i32.wgsl.expected.hlsl | 8 ++++ .../zero_init/vec4/i32.wgsl.expected.msl | 7 +++ .../zero_init/vec4/i32.wgsl.expected.spvasm | 28 ++++++++++++ .../zero_init/vec4/i32.wgsl.expected.wgsl | 3 ++ test/expressions/zero_init/vec4/u32.wgsl | 3 ++ .../zero_init/vec4/u32.wgsl.expected.hlsl | 8 ++++ .../zero_init/vec4/u32.wgsl.expected.msl | 7 +++ .../zero_init/vec4/u32.wgsl.expected.spvasm | 28 ++++++++++++ .../zero_init/vec4/u32.wgsl.expected.wgsl | 3 ++ 160 files changed, 1734 insertions(+) create mode 100644 test/expressions/zero_init/array/bool.wgsl create mode 100644 test/expressions/zero_init/array/bool.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/array/bool.wgsl.expected.msl create mode 100644 test/expressions/zero_init/array/bool.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/array/bool.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/array/f32.wgsl create mode 100644 test/expressions/zero_init/array/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/array/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/array/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/array/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/array/i32.wgsl create mode 100644 test/expressions/zero_init/array/i32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/array/i32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/array/i32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/array/i32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/array/struct.wgsl create mode 100644 test/expressions/zero_init/array/struct.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/array/struct.wgsl.expected.msl create mode 100644 test/expressions/zero_init/array/struct.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/array/struct.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/array/u32.wgsl create mode 100644 test/expressions/zero_init/array/u32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/array/u32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/array/u32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/array/u32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/mat2x2/f32.wgsl create mode 100644 test/expressions/zero_init/mat2x2/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/mat2x2/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/mat2x2/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/mat2x2/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/mat2x3/f32.wgsl create mode 100644 test/expressions/zero_init/mat2x3/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/mat2x3/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/mat2x3/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/mat2x3/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/mat2x4/f32.wgsl create mode 100644 test/expressions/zero_init/mat2x4/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/mat2x4/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/mat2x4/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/mat2x4/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/mat3x2/f32.wgsl create mode 100644 test/expressions/zero_init/mat3x2/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/mat3x2/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/mat3x2/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/mat3x2/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/mat3x3/f32.wgsl create mode 100644 test/expressions/zero_init/mat3x3/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/mat3x3/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/mat3x3/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/mat3x3/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/mat3x4/f32.wgsl create mode 100644 test/expressions/zero_init/mat3x4/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/mat3x4/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/mat3x4/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/mat3x4/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/mat4x2/f32.wgsl create mode 100644 test/expressions/zero_init/mat4x2/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/mat4x2/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/mat4x2/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/mat4x2/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/mat4x3/f32.wgsl create mode 100644 test/expressions/zero_init/mat4x3/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/mat4x3/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/mat4x3/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/mat4x3/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/mat4x4/f32.wgsl create mode 100644 test/expressions/zero_init/mat4x4/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/mat4x4/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/mat4x4/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/mat4x4/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/scalar/bool.wgsl create mode 100644 test/expressions/zero_init/scalar/bool.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/scalar/bool.wgsl.expected.msl create mode 100644 test/expressions/zero_init/scalar/bool.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/scalar/bool.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/scalar/f32.wgsl create mode 100644 test/expressions/zero_init/scalar/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/scalar/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/scalar/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/scalar/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/scalar/i32.wgsl create mode 100644 test/expressions/zero_init/scalar/i32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/scalar/i32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/scalar/i32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/scalar/i32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/scalar/u32.wgsl create mode 100644 test/expressions/zero_init/scalar/u32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/scalar/u32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/scalar/u32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/scalar/u32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/struct/array.wgsl create mode 100644 test/expressions/zero_init/struct/array.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/struct/array.wgsl.expected.msl create mode 100644 test/expressions/zero_init/struct/array.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/struct/array.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/struct/scalar.wgsl create mode 100644 test/expressions/zero_init/struct/scalar.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/struct/scalar.wgsl.expected.msl create mode 100644 test/expressions/zero_init/struct/scalar.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/struct/scalar.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/vec2/bool.wgsl create mode 100644 test/expressions/zero_init/vec2/bool.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/vec2/bool.wgsl.expected.msl create mode 100644 test/expressions/zero_init/vec2/bool.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/vec2/bool.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/vec2/f32.wgsl create mode 100644 test/expressions/zero_init/vec2/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/vec2/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/vec2/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/vec2/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/vec2/i32.wgsl create mode 100644 test/expressions/zero_init/vec2/i32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/vec2/i32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/vec2/i32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/vec2/i32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/vec2/u32.wgsl create mode 100644 test/expressions/zero_init/vec2/u32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/vec2/u32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/vec2/u32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/vec2/u32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/vec3/bool.wgsl create mode 100644 test/expressions/zero_init/vec3/bool.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/vec3/bool.wgsl.expected.msl create mode 100644 test/expressions/zero_init/vec3/bool.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/vec3/bool.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/vec3/f32.wgsl create mode 100644 test/expressions/zero_init/vec3/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/vec3/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/vec3/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/vec3/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/vec3/i32.wgsl create mode 100644 test/expressions/zero_init/vec3/i32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/vec3/i32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/vec3/i32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/vec3/i32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/vec3/u32.wgsl create mode 100644 test/expressions/zero_init/vec3/u32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/vec3/u32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/vec3/u32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/vec3/u32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/vec4/bool.wgsl create mode 100644 test/expressions/zero_init/vec4/bool.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/vec4/bool.wgsl.expected.msl create mode 100644 test/expressions/zero_init/vec4/bool.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/vec4/bool.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/vec4/f32.wgsl create mode 100644 test/expressions/zero_init/vec4/f32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/vec4/f32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/vec4/f32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/vec4/f32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/vec4/i32.wgsl create mode 100644 test/expressions/zero_init/vec4/i32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/vec4/i32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/vec4/i32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/vec4/i32.wgsl.expected.wgsl create mode 100644 test/expressions/zero_init/vec4/u32.wgsl create mode 100644 test/expressions/zero_init/vec4/u32.wgsl.expected.hlsl create mode 100644 test/expressions/zero_init/vec4/u32.wgsl.expected.msl create mode 100644 test/expressions/zero_init/vec4/u32.wgsl.expected.spvasm create mode 100644 test/expressions/zero_init/vec4/u32.wgsl.expected.wgsl diff --git a/test/expressions/zero_init/array/bool.wgsl b/test/expressions/zero_init/array/bool.wgsl new file mode 100644 index 0000000000..7df85e7fd4 --- /dev/null +++ b/test/expressions/zero_init/array/bool.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = array(); +} diff --git a/test/expressions/zero_init/array/bool.wgsl.expected.hlsl b/test/expressions/zero_init/array/bool.wgsl.expected.hlsl new file mode 100644 index 0000000000..eedc606e09 --- /dev/null +++ b/test/expressions/zero_init/array/bool.wgsl.expected.hlsl @@ -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}}; +} diff --git a/test/expressions/zero_init/array/bool.wgsl.expected.msl b/test/expressions/zero_init/array/bool.wgsl.expected.msl new file mode 100644 index 0000000000..ead82c7e6f --- /dev/null +++ b/test/expressions/zero_init/array/bool.wgsl.expected.msl @@ -0,0 +1,11 @@ +#include + +using namespace metal; +struct tint_array_wrapper { + bool arr[4]; +}; + +void f() { + tint_array_wrapper v = {.arr={}}; +} + diff --git a/test/expressions/zero_init/array/bool.wgsl.expected.spvasm b/test/expressions/zero_init/array/bool.wgsl.expected.spvasm new file mode 100644 index 0000000000..dd9ecffd5d --- /dev/null +++ b/test/expressions/zero_init/array/bool.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/array/bool.wgsl.expected.wgsl b/test/expressions/zero_init/array/bool.wgsl.expected.wgsl new file mode 100644 index 0000000000..c058d58848 --- /dev/null +++ b/test/expressions/zero_init/array/bool.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = array(); +} diff --git a/test/expressions/zero_init/array/f32.wgsl b/test/expressions/zero_init/array/f32.wgsl new file mode 100644 index 0000000000..1e6816bb77 --- /dev/null +++ b/test/expressions/zero_init/array/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = array(); +} diff --git a/test/expressions/zero_init/array/f32.wgsl.expected.hlsl b/test/expressions/zero_init/array/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..652c835199 --- /dev/null +++ b/test/expressions/zero_init/array/f32.wgsl.expected.hlsl @@ -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}}; +} diff --git a/test/expressions/zero_init/array/f32.wgsl.expected.msl b/test/expressions/zero_init/array/f32.wgsl.expected.msl new file mode 100644 index 0000000000..7a8df6c368 --- /dev/null +++ b/test/expressions/zero_init/array/f32.wgsl.expected.msl @@ -0,0 +1,11 @@ +#include + +using namespace metal; +struct tint_array_wrapper { + float arr[4]; +}; + +void f() { + tint_array_wrapper v = {.arr={}}; +} + diff --git a/test/expressions/zero_init/array/f32.wgsl.expected.spvasm b/test/expressions/zero_init/array/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..c44704ba7e --- /dev/null +++ b/test/expressions/zero_init/array/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/array/f32.wgsl.expected.wgsl b/test/expressions/zero_init/array/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..a60e712163 --- /dev/null +++ b/test/expressions/zero_init/array/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = array(); +} diff --git a/test/expressions/zero_init/array/i32.wgsl b/test/expressions/zero_init/array/i32.wgsl new file mode 100644 index 0000000000..a6c69cb759 --- /dev/null +++ b/test/expressions/zero_init/array/i32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = array(); +} diff --git a/test/expressions/zero_init/array/i32.wgsl.expected.hlsl b/test/expressions/zero_init/array/i32.wgsl.expected.hlsl new file mode 100644 index 0000000000..94a6069881 --- /dev/null +++ b/test/expressions/zero_init/array/i32.wgsl.expected.hlsl @@ -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}}; +} diff --git a/test/expressions/zero_init/array/i32.wgsl.expected.msl b/test/expressions/zero_init/array/i32.wgsl.expected.msl new file mode 100644 index 0000000000..e8cd266394 --- /dev/null +++ b/test/expressions/zero_init/array/i32.wgsl.expected.msl @@ -0,0 +1,11 @@ +#include + +using namespace metal; +struct tint_array_wrapper { + int arr[4]; +}; + +void f() { + tint_array_wrapper v = {.arr={}}; +} + diff --git a/test/expressions/zero_init/array/i32.wgsl.expected.spvasm b/test/expressions/zero_init/array/i32.wgsl.expected.spvasm new file mode 100644 index 0000000000..1fe83f3173 --- /dev/null +++ b/test/expressions/zero_init/array/i32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/array/i32.wgsl.expected.wgsl b/test/expressions/zero_init/array/i32.wgsl.expected.wgsl new file mode 100644 index 0000000000..0983f63d6a --- /dev/null +++ b/test/expressions/zero_init/array/i32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = array(); +} diff --git a/test/expressions/zero_init/array/struct.wgsl b/test/expressions/zero_init/array/struct.wgsl new file mode 100644 index 0000000000..e563640f53 --- /dev/null +++ b/test/expressions/zero_init/array/struct.wgsl @@ -0,0 +1,10 @@ +struct S { + i : i32; + u : u32; + f : f32; + b : bool; +}; + +fn f() { + var v = array(); +} diff --git a/test/expressions/zero_init/array/struct.wgsl.expected.hlsl b/test/expressions/zero_init/array/struct.wgsl.expected.hlsl new file mode 100644 index 0000000000..dbe7bdfe91 --- /dev/null +++ b/test/expressions/zero_init/array/struct.wgsl.expected.hlsl @@ -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}}}; +} diff --git a/test/expressions/zero_init/array/struct.wgsl.expected.msl b/test/expressions/zero_init/array/struct.wgsl.expected.msl new file mode 100644 index 0000000000..8dc9f2e750 --- /dev/null +++ b/test/expressions/zero_init/array/struct.wgsl.expected.msl @@ -0,0 +1,17 @@ +#include + +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={}}; +} + diff --git a/test/expressions/zero_init/array/struct.wgsl.expected.spvasm b/test/expressions/zero_init/array/struct.wgsl.expected.spvasm new file mode 100644 index 0000000000..7014af975f --- /dev/null +++ b/test/expressions/zero_init/array/struct.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/array/struct.wgsl.expected.wgsl b/test/expressions/zero_init/array/struct.wgsl.expected.wgsl new file mode 100644 index 0000000000..939e93be79 --- /dev/null +++ b/test/expressions/zero_init/array/struct.wgsl.expected.wgsl @@ -0,0 +1,10 @@ +struct S { + i : i32; + u : u32; + f : f32; + b : bool; +}; + +fn f() { + var v = array(); +} diff --git a/test/expressions/zero_init/array/u32.wgsl b/test/expressions/zero_init/array/u32.wgsl new file mode 100644 index 0000000000..2ad37e5d37 --- /dev/null +++ b/test/expressions/zero_init/array/u32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = array(); +} diff --git a/test/expressions/zero_init/array/u32.wgsl.expected.hlsl b/test/expressions/zero_init/array/u32.wgsl.expected.hlsl new file mode 100644 index 0000000000..6d036daaa3 --- /dev/null +++ b/test/expressions/zero_init/array/u32.wgsl.expected.hlsl @@ -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}}; +} diff --git a/test/expressions/zero_init/array/u32.wgsl.expected.msl b/test/expressions/zero_init/array/u32.wgsl.expected.msl new file mode 100644 index 0000000000..83dceb066b --- /dev/null +++ b/test/expressions/zero_init/array/u32.wgsl.expected.msl @@ -0,0 +1,11 @@ +#include + +using namespace metal; +struct tint_array_wrapper { + uint arr[4]; +}; + +void f() { + tint_array_wrapper v = {.arr={}}; +} + diff --git a/test/expressions/zero_init/array/u32.wgsl.expected.spvasm b/test/expressions/zero_init/array/u32.wgsl.expected.spvasm new file mode 100644 index 0000000000..16e60e6594 --- /dev/null +++ b/test/expressions/zero_init/array/u32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/array/u32.wgsl.expected.wgsl b/test/expressions/zero_init/array/u32.wgsl.expected.wgsl new file mode 100644 index 0000000000..36003efbc5 --- /dev/null +++ b/test/expressions/zero_init/array/u32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = array(); +} diff --git a/test/expressions/zero_init/mat2x2/f32.wgsl b/test/expressions/zero_init/mat2x2/f32.wgsl new file mode 100644 index 0000000000..a3349b1a3e --- /dev/null +++ b/test/expressions/zero_init/mat2x2/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat2x2(); +} diff --git a/test/expressions/zero_init/mat2x2/f32.wgsl.expected.hlsl b/test/expressions/zero_init/mat2x2/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..d711f2289f --- /dev/null +++ b/test/expressions/zero_init/mat2x2/f32.wgsl.expected.hlsl @@ -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); +} diff --git a/test/expressions/zero_init/mat2x2/f32.wgsl.expected.msl b/test/expressions/zero_init/mat2x2/f32.wgsl.expected.msl new file mode 100644 index 0000000000..323a16b57a --- /dev/null +++ b/test/expressions/zero_init/mat2x2/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float2x2 v = float2x2(); +} + diff --git a/test/expressions/zero_init/mat2x2/f32.wgsl.expected.spvasm b/test/expressions/zero_init/mat2x2/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..7ad3d3b75c --- /dev/null +++ b/test/expressions/zero_init/mat2x2/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/mat2x2/f32.wgsl.expected.wgsl b/test/expressions/zero_init/mat2x2/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..8987148a1d --- /dev/null +++ b/test/expressions/zero_init/mat2x2/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat2x2(); +} diff --git a/test/expressions/zero_init/mat2x3/f32.wgsl b/test/expressions/zero_init/mat2x3/f32.wgsl new file mode 100644 index 0000000000..070c6c69f3 --- /dev/null +++ b/test/expressions/zero_init/mat2x3/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat2x3(); +} diff --git a/test/expressions/zero_init/mat2x3/f32.wgsl.expected.hlsl b/test/expressions/zero_init/mat2x3/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..76872743a9 --- /dev/null +++ b/test/expressions/zero_init/mat2x3/f32.wgsl.expected.hlsl @@ -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); +} diff --git a/test/expressions/zero_init/mat2x3/f32.wgsl.expected.msl b/test/expressions/zero_init/mat2x3/f32.wgsl.expected.msl new file mode 100644 index 0000000000..6b1c1a6d8a --- /dev/null +++ b/test/expressions/zero_init/mat2x3/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float2x3 v = float2x3(); +} + diff --git a/test/expressions/zero_init/mat2x3/f32.wgsl.expected.spvasm b/test/expressions/zero_init/mat2x3/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..47a0aaa2b8 --- /dev/null +++ b/test/expressions/zero_init/mat2x3/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/mat2x3/f32.wgsl.expected.wgsl b/test/expressions/zero_init/mat2x3/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..8dcb021ad9 --- /dev/null +++ b/test/expressions/zero_init/mat2x3/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat2x3(); +} diff --git a/test/expressions/zero_init/mat2x4/f32.wgsl b/test/expressions/zero_init/mat2x4/f32.wgsl new file mode 100644 index 0000000000..69ceaf6d8a --- /dev/null +++ b/test/expressions/zero_init/mat2x4/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat2x4(); +} diff --git a/test/expressions/zero_init/mat2x4/f32.wgsl.expected.hlsl b/test/expressions/zero_init/mat2x4/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..fee298a456 --- /dev/null +++ b/test/expressions/zero_init/mat2x4/f32.wgsl.expected.hlsl @@ -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); +} diff --git a/test/expressions/zero_init/mat2x4/f32.wgsl.expected.msl b/test/expressions/zero_init/mat2x4/f32.wgsl.expected.msl new file mode 100644 index 0000000000..07088be241 --- /dev/null +++ b/test/expressions/zero_init/mat2x4/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float2x4 v = float2x4(); +} + diff --git a/test/expressions/zero_init/mat2x4/f32.wgsl.expected.spvasm b/test/expressions/zero_init/mat2x4/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..1f9135700f --- /dev/null +++ b/test/expressions/zero_init/mat2x4/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/mat2x4/f32.wgsl.expected.wgsl b/test/expressions/zero_init/mat2x4/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..16c89e0d04 --- /dev/null +++ b/test/expressions/zero_init/mat2x4/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat2x4(); +} diff --git a/test/expressions/zero_init/mat3x2/f32.wgsl b/test/expressions/zero_init/mat3x2/f32.wgsl new file mode 100644 index 0000000000..8b5d3ab235 --- /dev/null +++ b/test/expressions/zero_init/mat3x2/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat3x2(); +} diff --git a/test/expressions/zero_init/mat3x2/f32.wgsl.expected.hlsl b/test/expressions/zero_init/mat3x2/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..69c6a43c10 --- /dev/null +++ b/test/expressions/zero_init/mat3x2/f32.wgsl.expected.hlsl @@ -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); +} diff --git a/test/expressions/zero_init/mat3x2/f32.wgsl.expected.msl b/test/expressions/zero_init/mat3x2/f32.wgsl.expected.msl new file mode 100644 index 0000000000..8f611d235c --- /dev/null +++ b/test/expressions/zero_init/mat3x2/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float3x2 v = float3x2(); +} + diff --git a/test/expressions/zero_init/mat3x2/f32.wgsl.expected.spvasm b/test/expressions/zero_init/mat3x2/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..9e72aa83b6 --- /dev/null +++ b/test/expressions/zero_init/mat3x2/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/mat3x2/f32.wgsl.expected.wgsl b/test/expressions/zero_init/mat3x2/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..4041b7136e --- /dev/null +++ b/test/expressions/zero_init/mat3x2/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat3x2(); +} diff --git a/test/expressions/zero_init/mat3x3/f32.wgsl b/test/expressions/zero_init/mat3x3/f32.wgsl new file mode 100644 index 0000000000..f0b2c70f9a --- /dev/null +++ b/test/expressions/zero_init/mat3x3/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat3x3(); +} diff --git a/test/expressions/zero_init/mat3x3/f32.wgsl.expected.hlsl b/test/expressions/zero_init/mat3x3/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..a75039f80e --- /dev/null +++ b/test/expressions/zero_init/mat3x3/f32.wgsl.expected.hlsl @@ -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); +} diff --git a/test/expressions/zero_init/mat3x3/f32.wgsl.expected.msl b/test/expressions/zero_init/mat3x3/f32.wgsl.expected.msl new file mode 100644 index 0000000000..46aa385cfa --- /dev/null +++ b/test/expressions/zero_init/mat3x3/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float3x3 v = float3x3(); +} + diff --git a/test/expressions/zero_init/mat3x3/f32.wgsl.expected.spvasm b/test/expressions/zero_init/mat3x3/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..10c69db9c8 --- /dev/null +++ b/test/expressions/zero_init/mat3x3/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/mat3x3/f32.wgsl.expected.wgsl b/test/expressions/zero_init/mat3x3/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..366671cf68 --- /dev/null +++ b/test/expressions/zero_init/mat3x3/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat3x3(); +} diff --git a/test/expressions/zero_init/mat3x4/f32.wgsl b/test/expressions/zero_init/mat3x4/f32.wgsl new file mode 100644 index 0000000000..8757041d6a --- /dev/null +++ b/test/expressions/zero_init/mat3x4/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat3x4(); +} diff --git a/test/expressions/zero_init/mat3x4/f32.wgsl.expected.hlsl b/test/expressions/zero_init/mat3x4/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..2b08d5f47e --- /dev/null +++ b/test/expressions/zero_init/mat3x4/f32.wgsl.expected.hlsl @@ -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); +} diff --git a/test/expressions/zero_init/mat3x4/f32.wgsl.expected.msl b/test/expressions/zero_init/mat3x4/f32.wgsl.expected.msl new file mode 100644 index 0000000000..21f15d0b22 --- /dev/null +++ b/test/expressions/zero_init/mat3x4/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float3x4 v = float3x4(); +} + diff --git a/test/expressions/zero_init/mat3x4/f32.wgsl.expected.spvasm b/test/expressions/zero_init/mat3x4/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..8e00da528b --- /dev/null +++ b/test/expressions/zero_init/mat3x4/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/mat3x4/f32.wgsl.expected.wgsl b/test/expressions/zero_init/mat3x4/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..d286020b1e --- /dev/null +++ b/test/expressions/zero_init/mat3x4/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat3x4(); +} diff --git a/test/expressions/zero_init/mat4x2/f32.wgsl b/test/expressions/zero_init/mat4x2/f32.wgsl new file mode 100644 index 0000000000..0b47e40f25 --- /dev/null +++ b/test/expressions/zero_init/mat4x2/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat4x2(); +} diff --git a/test/expressions/zero_init/mat4x2/f32.wgsl.expected.hlsl b/test/expressions/zero_init/mat4x2/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..ceba05a00b --- /dev/null +++ b/test/expressions/zero_init/mat4x2/f32.wgsl.expected.hlsl @@ -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); +} diff --git a/test/expressions/zero_init/mat4x2/f32.wgsl.expected.msl b/test/expressions/zero_init/mat4x2/f32.wgsl.expected.msl new file mode 100644 index 0000000000..5c2410f7ac --- /dev/null +++ b/test/expressions/zero_init/mat4x2/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float4x2 v = float4x2(); +} + diff --git a/test/expressions/zero_init/mat4x2/f32.wgsl.expected.spvasm b/test/expressions/zero_init/mat4x2/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..bc0a3a3db9 --- /dev/null +++ b/test/expressions/zero_init/mat4x2/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/mat4x2/f32.wgsl.expected.wgsl b/test/expressions/zero_init/mat4x2/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..c88d768fb9 --- /dev/null +++ b/test/expressions/zero_init/mat4x2/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat4x2(); +} diff --git a/test/expressions/zero_init/mat4x3/f32.wgsl b/test/expressions/zero_init/mat4x3/f32.wgsl new file mode 100644 index 0000000000..532ed375b8 --- /dev/null +++ b/test/expressions/zero_init/mat4x3/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat4x3(); +} diff --git a/test/expressions/zero_init/mat4x3/f32.wgsl.expected.hlsl b/test/expressions/zero_init/mat4x3/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..6b43a167cf --- /dev/null +++ b/test/expressions/zero_init/mat4x3/f32.wgsl.expected.hlsl @@ -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); +} diff --git a/test/expressions/zero_init/mat4x3/f32.wgsl.expected.msl b/test/expressions/zero_init/mat4x3/f32.wgsl.expected.msl new file mode 100644 index 0000000000..80c8b94d7f --- /dev/null +++ b/test/expressions/zero_init/mat4x3/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float4x3 v = float4x3(); +} + diff --git a/test/expressions/zero_init/mat4x3/f32.wgsl.expected.spvasm b/test/expressions/zero_init/mat4x3/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..ca6300dd82 --- /dev/null +++ b/test/expressions/zero_init/mat4x3/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/mat4x3/f32.wgsl.expected.wgsl b/test/expressions/zero_init/mat4x3/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..479de8e132 --- /dev/null +++ b/test/expressions/zero_init/mat4x3/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat4x3(); +} diff --git a/test/expressions/zero_init/mat4x4/f32.wgsl b/test/expressions/zero_init/mat4x4/f32.wgsl new file mode 100644 index 0000000000..158a92776d --- /dev/null +++ b/test/expressions/zero_init/mat4x4/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat4x4(); +} diff --git a/test/expressions/zero_init/mat4x4/f32.wgsl.expected.hlsl b/test/expressions/zero_init/mat4x4/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..72825c9119 --- /dev/null +++ b/test/expressions/zero_init/mat4x4/f32.wgsl.expected.hlsl @@ -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); +} diff --git a/test/expressions/zero_init/mat4x4/f32.wgsl.expected.msl b/test/expressions/zero_init/mat4x4/f32.wgsl.expected.msl new file mode 100644 index 0000000000..9b2c252ed4 --- /dev/null +++ b/test/expressions/zero_init/mat4x4/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float4x4 v = float4x4(); +} + diff --git a/test/expressions/zero_init/mat4x4/f32.wgsl.expected.spvasm b/test/expressions/zero_init/mat4x4/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..f156dd27d8 --- /dev/null +++ b/test/expressions/zero_init/mat4x4/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/mat4x4/f32.wgsl.expected.wgsl b/test/expressions/zero_init/mat4x4/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..b26a979eee --- /dev/null +++ b/test/expressions/zero_init/mat4x4/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = mat4x4(); +} diff --git a/test/expressions/zero_init/scalar/bool.wgsl b/test/expressions/zero_init/scalar/bool.wgsl new file mode 100644 index 0000000000..8766ac5b46 --- /dev/null +++ b/test/expressions/zero_init/scalar/bool.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = bool(); +} diff --git a/test/expressions/zero_init/scalar/bool.wgsl.expected.hlsl b/test/expressions/zero_init/scalar/bool.wgsl.expected.hlsl new file mode 100644 index 0000000000..e3a07b66e9 --- /dev/null +++ b/test/expressions/zero_init/scalar/bool.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + bool v = false; +} diff --git a/test/expressions/zero_init/scalar/bool.wgsl.expected.msl b/test/expressions/zero_init/scalar/bool.wgsl.expected.msl new file mode 100644 index 0000000000..a68d88c79d --- /dev/null +++ b/test/expressions/zero_init/scalar/bool.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + bool v = bool(); +} + diff --git a/test/expressions/zero_init/scalar/bool.wgsl.expected.spvasm b/test/expressions/zero_init/scalar/bool.wgsl.expected.spvasm new file mode 100644 index 0000000000..396811b885 --- /dev/null +++ b/test/expressions/zero_init/scalar/bool.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/scalar/bool.wgsl.expected.wgsl b/test/expressions/zero_init/scalar/bool.wgsl.expected.wgsl new file mode 100644 index 0000000000..146584dbae --- /dev/null +++ b/test/expressions/zero_init/scalar/bool.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = bool(); +} diff --git a/test/expressions/zero_init/scalar/f32.wgsl b/test/expressions/zero_init/scalar/f32.wgsl new file mode 100644 index 0000000000..e8ed35f15e --- /dev/null +++ b/test/expressions/zero_init/scalar/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = f32(); +} diff --git a/test/expressions/zero_init/scalar/f32.wgsl.expected.hlsl b/test/expressions/zero_init/scalar/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..ed23c73028 --- /dev/null +++ b/test/expressions/zero_init/scalar/f32.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + float v = 0.0f; +} diff --git a/test/expressions/zero_init/scalar/f32.wgsl.expected.msl b/test/expressions/zero_init/scalar/f32.wgsl.expected.msl new file mode 100644 index 0000000000..7e8266ed6a --- /dev/null +++ b/test/expressions/zero_init/scalar/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float v = float(); +} + diff --git a/test/expressions/zero_init/scalar/f32.wgsl.expected.spvasm b/test/expressions/zero_init/scalar/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..dac010101a --- /dev/null +++ b/test/expressions/zero_init/scalar/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/scalar/f32.wgsl.expected.wgsl b/test/expressions/zero_init/scalar/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..b72e28dea4 --- /dev/null +++ b/test/expressions/zero_init/scalar/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = f32(); +} diff --git a/test/expressions/zero_init/scalar/i32.wgsl b/test/expressions/zero_init/scalar/i32.wgsl new file mode 100644 index 0000000000..de560ef043 --- /dev/null +++ b/test/expressions/zero_init/scalar/i32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = i32(); +} diff --git a/test/expressions/zero_init/scalar/i32.wgsl.expected.hlsl b/test/expressions/zero_init/scalar/i32.wgsl.expected.hlsl new file mode 100644 index 0000000000..dd9b566641 --- /dev/null +++ b/test/expressions/zero_init/scalar/i32.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + int v = 0; +} diff --git a/test/expressions/zero_init/scalar/i32.wgsl.expected.msl b/test/expressions/zero_init/scalar/i32.wgsl.expected.msl new file mode 100644 index 0000000000..222df20d76 --- /dev/null +++ b/test/expressions/zero_init/scalar/i32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + int v = int(); +} + diff --git a/test/expressions/zero_init/scalar/i32.wgsl.expected.spvasm b/test/expressions/zero_init/scalar/i32.wgsl.expected.spvasm new file mode 100644 index 0000000000..f2b78bdc7f --- /dev/null +++ b/test/expressions/zero_init/scalar/i32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/scalar/i32.wgsl.expected.wgsl b/test/expressions/zero_init/scalar/i32.wgsl.expected.wgsl new file mode 100644 index 0000000000..6b5c0a09dc --- /dev/null +++ b/test/expressions/zero_init/scalar/i32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = i32(); +} diff --git a/test/expressions/zero_init/scalar/u32.wgsl b/test/expressions/zero_init/scalar/u32.wgsl new file mode 100644 index 0000000000..bec78d6357 --- /dev/null +++ b/test/expressions/zero_init/scalar/u32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = u32(); +} diff --git a/test/expressions/zero_init/scalar/u32.wgsl.expected.hlsl b/test/expressions/zero_init/scalar/u32.wgsl.expected.hlsl new file mode 100644 index 0000000000..58f3b9a8aa --- /dev/null +++ b/test/expressions/zero_init/scalar/u32.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + uint v = 0u; +} diff --git a/test/expressions/zero_init/scalar/u32.wgsl.expected.msl b/test/expressions/zero_init/scalar/u32.wgsl.expected.msl new file mode 100644 index 0000000000..e11e857be4 --- /dev/null +++ b/test/expressions/zero_init/scalar/u32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + uint v = uint(); +} + diff --git a/test/expressions/zero_init/scalar/u32.wgsl.expected.spvasm b/test/expressions/zero_init/scalar/u32.wgsl.expected.spvasm new file mode 100644 index 0000000000..83252c52cb --- /dev/null +++ b/test/expressions/zero_init/scalar/u32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/scalar/u32.wgsl.expected.wgsl b/test/expressions/zero_init/scalar/u32.wgsl.expected.wgsl new file mode 100644 index 0000000000..4e3fd82e8e --- /dev/null +++ b/test/expressions/zero_init/scalar/u32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = u32(); +} diff --git a/test/expressions/zero_init/struct/array.wgsl b/test/expressions/zero_init/struct/array.wgsl new file mode 100644 index 0000000000..148b4576cf --- /dev/null +++ b/test/expressions/zero_init/struct/array.wgsl @@ -0,0 +1,7 @@ +struct S { + a : array; +}; + +fn f() { + var v = S(); +} diff --git a/test/expressions/zero_init/struct/array.wgsl.expected.hlsl b/test/expressions/zero_init/struct/array.wgsl.expected.hlsl new file mode 100644 index 0000000000..6bb77c65f7 --- /dev/null +++ b/test/expressions/zero_init/struct/array.wgsl.expected.hlsl @@ -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}}}; +} diff --git a/test/expressions/zero_init/struct/array.wgsl.expected.msl b/test/expressions/zero_init/struct/array.wgsl.expected.msl new file mode 100644 index 0000000000..61b9dc1c92 --- /dev/null +++ b/test/expressions/zero_init/struct/array.wgsl.expected.msl @@ -0,0 +1,14 @@ +#include + +using namespace metal; +struct tint_array_wrapper { + float arr[4]; +}; +struct S { + tint_array_wrapper a; +}; + +void f() { + S v = {}; +} + diff --git a/test/expressions/zero_init/struct/array.wgsl.expected.spvasm b/test/expressions/zero_init/struct/array.wgsl.expected.spvasm new file mode 100644 index 0000000000..bb96631719 --- /dev/null +++ b/test/expressions/zero_init/struct/array.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/struct/array.wgsl.expected.wgsl b/test/expressions/zero_init/struct/array.wgsl.expected.wgsl new file mode 100644 index 0000000000..522939f0e5 --- /dev/null +++ b/test/expressions/zero_init/struct/array.wgsl.expected.wgsl @@ -0,0 +1,7 @@ +struct S { + a : array; +}; + +fn f() { + var v = S(); +} diff --git a/test/expressions/zero_init/struct/scalar.wgsl b/test/expressions/zero_init/struct/scalar.wgsl new file mode 100644 index 0000000000..a1c58b39a2 --- /dev/null +++ b/test/expressions/zero_init/struct/scalar.wgsl @@ -0,0 +1,10 @@ +struct S { + i : i32; + u : u32; + f : f32; + b : bool; +}; + +fn f() { + var v = S(); +} diff --git a/test/expressions/zero_init/struct/scalar.wgsl.expected.hlsl b/test/expressions/zero_init/struct/scalar.wgsl.expected.hlsl new file mode 100644 index 0000000000..29925fffa1 --- /dev/null +++ b/test/expressions/zero_init/struct/scalar.wgsl.expected.hlsl @@ -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}; +} diff --git a/test/expressions/zero_init/struct/scalar.wgsl.expected.msl b/test/expressions/zero_init/struct/scalar.wgsl.expected.msl new file mode 100644 index 0000000000..b72ea5e63e --- /dev/null +++ b/test/expressions/zero_init/struct/scalar.wgsl.expected.msl @@ -0,0 +1,14 @@ +#include + +using namespace metal; +struct S { + int i; + uint u; + float f; + bool b; +}; + +void f() { + S v = {}; +} + diff --git a/test/expressions/zero_init/struct/scalar.wgsl.expected.spvasm b/test/expressions/zero_init/struct/scalar.wgsl.expected.spvasm new file mode 100644 index 0000000000..1990f38bdf --- /dev/null +++ b/test/expressions/zero_init/struct/scalar.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/struct/scalar.wgsl.expected.wgsl b/test/expressions/zero_init/struct/scalar.wgsl.expected.wgsl new file mode 100644 index 0000000000..0da534fa25 --- /dev/null +++ b/test/expressions/zero_init/struct/scalar.wgsl.expected.wgsl @@ -0,0 +1,10 @@ +struct S { + i : i32; + u : u32; + f : f32; + b : bool; +}; + +fn f() { + var v = S(); +} diff --git a/test/expressions/zero_init/vec2/bool.wgsl b/test/expressions/zero_init/vec2/bool.wgsl new file mode 100644 index 0000000000..3ae73b2af0 --- /dev/null +++ b/test/expressions/zero_init/vec2/bool.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec2(); +} diff --git a/test/expressions/zero_init/vec2/bool.wgsl.expected.hlsl b/test/expressions/zero_init/vec2/bool.wgsl.expected.hlsl new file mode 100644 index 0000000000..bad31ebdf8 --- /dev/null +++ b/test/expressions/zero_init/vec2/bool.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + bool2 v = bool2(false, false); +} diff --git a/test/expressions/zero_init/vec2/bool.wgsl.expected.msl b/test/expressions/zero_init/vec2/bool.wgsl.expected.msl new file mode 100644 index 0000000000..fd03aaf1b9 --- /dev/null +++ b/test/expressions/zero_init/vec2/bool.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + bool2 v = bool2(); +} + diff --git a/test/expressions/zero_init/vec2/bool.wgsl.expected.spvasm b/test/expressions/zero_init/vec2/bool.wgsl.expected.spvasm new file mode 100644 index 0000000000..7ca8e258b4 --- /dev/null +++ b/test/expressions/zero_init/vec2/bool.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/vec2/bool.wgsl.expected.wgsl b/test/expressions/zero_init/vec2/bool.wgsl.expected.wgsl new file mode 100644 index 0000000000..083160cf69 --- /dev/null +++ b/test/expressions/zero_init/vec2/bool.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec2(); +} diff --git a/test/expressions/zero_init/vec2/f32.wgsl b/test/expressions/zero_init/vec2/f32.wgsl new file mode 100644 index 0000000000..edb7398081 --- /dev/null +++ b/test/expressions/zero_init/vec2/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec2(); +} diff --git a/test/expressions/zero_init/vec2/f32.wgsl.expected.hlsl b/test/expressions/zero_init/vec2/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..45a2969de6 --- /dev/null +++ b/test/expressions/zero_init/vec2/f32.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + float2 v = float2(0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/vec2/f32.wgsl.expected.msl b/test/expressions/zero_init/vec2/f32.wgsl.expected.msl new file mode 100644 index 0000000000..07013f1e94 --- /dev/null +++ b/test/expressions/zero_init/vec2/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float2 v = float2(); +} + diff --git a/test/expressions/zero_init/vec2/f32.wgsl.expected.spvasm b/test/expressions/zero_init/vec2/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..4c882b72c3 --- /dev/null +++ b/test/expressions/zero_init/vec2/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/vec2/f32.wgsl.expected.wgsl b/test/expressions/zero_init/vec2/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..fb17f6de08 --- /dev/null +++ b/test/expressions/zero_init/vec2/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec2(); +} diff --git a/test/expressions/zero_init/vec2/i32.wgsl b/test/expressions/zero_init/vec2/i32.wgsl new file mode 100644 index 0000000000..be800b399d --- /dev/null +++ b/test/expressions/zero_init/vec2/i32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec2(); +} diff --git a/test/expressions/zero_init/vec2/i32.wgsl.expected.hlsl b/test/expressions/zero_init/vec2/i32.wgsl.expected.hlsl new file mode 100644 index 0000000000..8c92953daf --- /dev/null +++ b/test/expressions/zero_init/vec2/i32.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + int2 v = int2(0, 0); +} diff --git a/test/expressions/zero_init/vec2/i32.wgsl.expected.msl b/test/expressions/zero_init/vec2/i32.wgsl.expected.msl new file mode 100644 index 0000000000..d29f4d1df9 --- /dev/null +++ b/test/expressions/zero_init/vec2/i32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + int2 v = int2(); +} + diff --git a/test/expressions/zero_init/vec2/i32.wgsl.expected.spvasm b/test/expressions/zero_init/vec2/i32.wgsl.expected.spvasm new file mode 100644 index 0000000000..c29deb5aee --- /dev/null +++ b/test/expressions/zero_init/vec2/i32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/vec2/i32.wgsl.expected.wgsl b/test/expressions/zero_init/vec2/i32.wgsl.expected.wgsl new file mode 100644 index 0000000000..ebf1dfa144 --- /dev/null +++ b/test/expressions/zero_init/vec2/i32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec2(); +} diff --git a/test/expressions/zero_init/vec2/u32.wgsl b/test/expressions/zero_init/vec2/u32.wgsl new file mode 100644 index 0000000000..47ad9d19d3 --- /dev/null +++ b/test/expressions/zero_init/vec2/u32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec2(); +} diff --git a/test/expressions/zero_init/vec2/u32.wgsl.expected.hlsl b/test/expressions/zero_init/vec2/u32.wgsl.expected.hlsl new file mode 100644 index 0000000000..4b9581f773 --- /dev/null +++ b/test/expressions/zero_init/vec2/u32.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + uint2 v = uint2(0u, 0u); +} diff --git a/test/expressions/zero_init/vec2/u32.wgsl.expected.msl b/test/expressions/zero_init/vec2/u32.wgsl.expected.msl new file mode 100644 index 0000000000..9c0f70cf37 --- /dev/null +++ b/test/expressions/zero_init/vec2/u32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + uint2 v = uint2(); +} + diff --git a/test/expressions/zero_init/vec2/u32.wgsl.expected.spvasm b/test/expressions/zero_init/vec2/u32.wgsl.expected.spvasm new file mode 100644 index 0000000000..b95fe040e4 --- /dev/null +++ b/test/expressions/zero_init/vec2/u32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/vec2/u32.wgsl.expected.wgsl b/test/expressions/zero_init/vec2/u32.wgsl.expected.wgsl new file mode 100644 index 0000000000..996357df82 --- /dev/null +++ b/test/expressions/zero_init/vec2/u32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec2(); +} diff --git a/test/expressions/zero_init/vec3/bool.wgsl b/test/expressions/zero_init/vec3/bool.wgsl new file mode 100644 index 0000000000..17bf61f6a0 --- /dev/null +++ b/test/expressions/zero_init/vec3/bool.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec3(); +} diff --git a/test/expressions/zero_init/vec3/bool.wgsl.expected.hlsl b/test/expressions/zero_init/vec3/bool.wgsl.expected.hlsl new file mode 100644 index 0000000000..5e6f7f7064 --- /dev/null +++ b/test/expressions/zero_init/vec3/bool.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + bool3 v = bool3(false, false, false); +} diff --git a/test/expressions/zero_init/vec3/bool.wgsl.expected.msl b/test/expressions/zero_init/vec3/bool.wgsl.expected.msl new file mode 100644 index 0000000000..fa8cb80ed5 --- /dev/null +++ b/test/expressions/zero_init/vec3/bool.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + bool3 v = bool3(); +} + diff --git a/test/expressions/zero_init/vec3/bool.wgsl.expected.spvasm b/test/expressions/zero_init/vec3/bool.wgsl.expected.spvasm new file mode 100644 index 0000000000..ab82c2b29b --- /dev/null +++ b/test/expressions/zero_init/vec3/bool.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/vec3/bool.wgsl.expected.wgsl b/test/expressions/zero_init/vec3/bool.wgsl.expected.wgsl new file mode 100644 index 0000000000..b002ca933b --- /dev/null +++ b/test/expressions/zero_init/vec3/bool.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec3(); +} diff --git a/test/expressions/zero_init/vec3/f32.wgsl b/test/expressions/zero_init/vec3/f32.wgsl new file mode 100644 index 0000000000..08133af653 --- /dev/null +++ b/test/expressions/zero_init/vec3/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec3(); +} diff --git a/test/expressions/zero_init/vec3/f32.wgsl.expected.hlsl b/test/expressions/zero_init/vec3/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..6f4b969e08 --- /dev/null +++ b/test/expressions/zero_init/vec3/f32.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + float3 v = float3(0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/vec3/f32.wgsl.expected.msl b/test/expressions/zero_init/vec3/f32.wgsl.expected.msl new file mode 100644 index 0000000000..c40910cd65 --- /dev/null +++ b/test/expressions/zero_init/vec3/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float3 v = float3(); +} + diff --git a/test/expressions/zero_init/vec3/f32.wgsl.expected.spvasm b/test/expressions/zero_init/vec3/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..d38366c98e --- /dev/null +++ b/test/expressions/zero_init/vec3/f32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/vec3/f32.wgsl.expected.wgsl b/test/expressions/zero_init/vec3/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..2448499f0f --- /dev/null +++ b/test/expressions/zero_init/vec3/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec3(); +} diff --git a/test/expressions/zero_init/vec3/i32.wgsl b/test/expressions/zero_init/vec3/i32.wgsl new file mode 100644 index 0000000000..534b7f41dd --- /dev/null +++ b/test/expressions/zero_init/vec3/i32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec3(); +} diff --git a/test/expressions/zero_init/vec3/i32.wgsl.expected.hlsl b/test/expressions/zero_init/vec3/i32.wgsl.expected.hlsl new file mode 100644 index 0000000000..5f68dd83b1 --- /dev/null +++ b/test/expressions/zero_init/vec3/i32.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + int3 v = int3(0, 0, 0); +} diff --git a/test/expressions/zero_init/vec3/i32.wgsl.expected.msl b/test/expressions/zero_init/vec3/i32.wgsl.expected.msl new file mode 100644 index 0000000000..86777661cc --- /dev/null +++ b/test/expressions/zero_init/vec3/i32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + int3 v = int3(); +} + diff --git a/test/expressions/zero_init/vec3/i32.wgsl.expected.spvasm b/test/expressions/zero_init/vec3/i32.wgsl.expected.spvasm new file mode 100644 index 0000000000..039a6f6c95 --- /dev/null +++ b/test/expressions/zero_init/vec3/i32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/vec3/i32.wgsl.expected.wgsl b/test/expressions/zero_init/vec3/i32.wgsl.expected.wgsl new file mode 100644 index 0000000000..16d8dbbd5c --- /dev/null +++ b/test/expressions/zero_init/vec3/i32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec3(); +} diff --git a/test/expressions/zero_init/vec3/u32.wgsl b/test/expressions/zero_init/vec3/u32.wgsl new file mode 100644 index 0000000000..b435bb1588 --- /dev/null +++ b/test/expressions/zero_init/vec3/u32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec3(); +} diff --git a/test/expressions/zero_init/vec3/u32.wgsl.expected.hlsl b/test/expressions/zero_init/vec3/u32.wgsl.expected.hlsl new file mode 100644 index 0000000000..01274d3af9 --- /dev/null +++ b/test/expressions/zero_init/vec3/u32.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + uint3 v = uint3(0u, 0u, 0u); +} diff --git a/test/expressions/zero_init/vec3/u32.wgsl.expected.msl b/test/expressions/zero_init/vec3/u32.wgsl.expected.msl new file mode 100644 index 0000000000..bb2de04b9d --- /dev/null +++ b/test/expressions/zero_init/vec3/u32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + uint3 v = uint3(); +} + diff --git a/test/expressions/zero_init/vec3/u32.wgsl.expected.spvasm b/test/expressions/zero_init/vec3/u32.wgsl.expected.spvasm new file mode 100644 index 0000000000..2950d7d458 --- /dev/null +++ b/test/expressions/zero_init/vec3/u32.wgsl.expected.spvasm @@ -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 diff --git a/test/expressions/zero_init/vec3/u32.wgsl.expected.wgsl b/test/expressions/zero_init/vec3/u32.wgsl.expected.wgsl new file mode 100644 index 0000000000..b88a5141be --- /dev/null +++ b/test/expressions/zero_init/vec3/u32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec3(); +} diff --git a/test/expressions/zero_init/vec4/bool.wgsl b/test/expressions/zero_init/vec4/bool.wgsl new file mode 100644 index 0000000000..7c67074565 --- /dev/null +++ b/test/expressions/zero_init/vec4/bool.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec4(); +} diff --git a/test/expressions/zero_init/vec4/bool.wgsl.expected.hlsl b/test/expressions/zero_init/vec4/bool.wgsl.expected.hlsl new file mode 100644 index 0000000000..af6543dc9e --- /dev/null +++ b/test/expressions/zero_init/vec4/bool.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + bool4 v = bool4(false, false, false, false); +} diff --git a/test/expressions/zero_init/vec4/bool.wgsl.expected.msl b/test/expressions/zero_init/vec4/bool.wgsl.expected.msl new file mode 100644 index 0000000000..0d3be82417 --- /dev/null +++ b/test/expressions/zero_init/vec4/bool.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + bool4 v = bool4(); +} + diff --git a/test/expressions/zero_init/vec4/bool.wgsl.expected.spvasm b/test/expressions/zero_init/vec4/bool.wgsl.expected.spvasm new file mode 100644 index 0000000000..b4485678a6 --- /dev/null +++ b/test/expressions/zero_init/vec4/bool.wgsl.expected.spvasm @@ -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 + %v4bool = OpTypeVector %bool 4 + %9 = OpConstantNull %v4bool +%_ptr_Function_v4bool = OpTypePointer Function %v4bool +%unused_entry_point = OpFunction %void None %1 + %4 = OpLabel + OpReturn + OpFunctionEnd + %f = OpFunction %void None %1 + %6 = OpLabel + %v = OpVariable %_ptr_Function_v4bool Function %9 + OpStore %v %9 + OpReturn + OpFunctionEnd diff --git a/test/expressions/zero_init/vec4/bool.wgsl.expected.wgsl b/test/expressions/zero_init/vec4/bool.wgsl.expected.wgsl new file mode 100644 index 0000000000..8cc421ccb6 --- /dev/null +++ b/test/expressions/zero_init/vec4/bool.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec4(); +} diff --git a/test/expressions/zero_init/vec4/f32.wgsl b/test/expressions/zero_init/vec4/f32.wgsl new file mode 100644 index 0000000000..02514287a1 --- /dev/null +++ b/test/expressions/zero_init/vec4/f32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec4(); +} diff --git a/test/expressions/zero_init/vec4/f32.wgsl.expected.hlsl b/test/expressions/zero_init/vec4/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..77c44c2fcd --- /dev/null +++ b/test/expressions/zero_init/vec4/f32.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + float4 v = float4(0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/test/expressions/zero_init/vec4/f32.wgsl.expected.msl b/test/expressions/zero_init/vec4/f32.wgsl.expected.msl new file mode 100644 index 0000000000..76c2b7798c --- /dev/null +++ b/test/expressions/zero_init/vec4/f32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + float4 v = float4(); +} + diff --git a/test/expressions/zero_init/vec4/f32.wgsl.expected.spvasm b/test/expressions/zero_init/vec4/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..c81af8d981 --- /dev/null +++ b/test/expressions/zero_init/vec4/f32.wgsl.expected.spvasm @@ -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 + %v4float = OpTypeVector %float 4 + %9 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float +%unused_entry_point = OpFunction %void None %1 + %4 = OpLabel + OpReturn + OpFunctionEnd + %f = OpFunction %void None %1 + %6 = OpLabel + %v = OpVariable %_ptr_Function_v4float Function %9 + OpStore %v %9 + OpReturn + OpFunctionEnd diff --git a/test/expressions/zero_init/vec4/f32.wgsl.expected.wgsl b/test/expressions/zero_init/vec4/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..f1652ac008 --- /dev/null +++ b/test/expressions/zero_init/vec4/f32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec4(); +} diff --git a/test/expressions/zero_init/vec4/i32.wgsl b/test/expressions/zero_init/vec4/i32.wgsl new file mode 100644 index 0000000000..908d3497df --- /dev/null +++ b/test/expressions/zero_init/vec4/i32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec4(); +} diff --git a/test/expressions/zero_init/vec4/i32.wgsl.expected.hlsl b/test/expressions/zero_init/vec4/i32.wgsl.expected.hlsl new file mode 100644 index 0000000000..5df80272b0 --- /dev/null +++ b/test/expressions/zero_init/vec4/i32.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + int4 v = int4(0, 0, 0, 0); +} diff --git a/test/expressions/zero_init/vec4/i32.wgsl.expected.msl b/test/expressions/zero_init/vec4/i32.wgsl.expected.msl new file mode 100644 index 0000000000..78ebdab612 --- /dev/null +++ b/test/expressions/zero_init/vec4/i32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + int4 v = int4(); +} + diff --git a/test/expressions/zero_init/vec4/i32.wgsl.expected.spvasm b/test/expressions/zero_init/vec4/i32.wgsl.expected.spvasm new file mode 100644 index 0000000000..d2d16781fb --- /dev/null +++ b/test/expressions/zero_init/vec4/i32.wgsl.expected.spvasm @@ -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 + %v4int = OpTypeVector %int 4 + %9 = OpConstantNull %v4int +%_ptr_Function_v4int = OpTypePointer Function %v4int +%unused_entry_point = OpFunction %void None %1 + %4 = OpLabel + OpReturn + OpFunctionEnd + %f = OpFunction %void None %1 + %6 = OpLabel + %v = OpVariable %_ptr_Function_v4int Function %9 + OpStore %v %9 + OpReturn + OpFunctionEnd diff --git a/test/expressions/zero_init/vec4/i32.wgsl.expected.wgsl b/test/expressions/zero_init/vec4/i32.wgsl.expected.wgsl new file mode 100644 index 0000000000..90705c657d --- /dev/null +++ b/test/expressions/zero_init/vec4/i32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec4(); +} diff --git a/test/expressions/zero_init/vec4/u32.wgsl b/test/expressions/zero_init/vec4/u32.wgsl new file mode 100644 index 0000000000..71477cf6ff --- /dev/null +++ b/test/expressions/zero_init/vec4/u32.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec4(); +} diff --git a/test/expressions/zero_init/vec4/u32.wgsl.expected.hlsl b/test/expressions/zero_init/vec4/u32.wgsl.expected.hlsl new file mode 100644 index 0000000000..0a7eccdc22 --- /dev/null +++ b/test/expressions/zero_init/vec4/u32.wgsl.expected.hlsl @@ -0,0 +1,8 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +void f() { + uint4 v = uint4(0u, 0u, 0u, 0u); +} diff --git a/test/expressions/zero_init/vec4/u32.wgsl.expected.msl b/test/expressions/zero_init/vec4/u32.wgsl.expected.msl new file mode 100644 index 0000000000..9d55361706 --- /dev/null +++ b/test/expressions/zero_init/vec4/u32.wgsl.expected.msl @@ -0,0 +1,7 @@ +#include + +using namespace metal; +void f() { + uint4 v = uint4(); +} + diff --git a/test/expressions/zero_init/vec4/u32.wgsl.expected.spvasm b/test/expressions/zero_init/vec4/u32.wgsl.expected.spvasm new file mode 100644 index 0000000000..d8e09113aa --- /dev/null +++ b/test/expressions/zero_init/vec4/u32.wgsl.expected.spvasm @@ -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 + %v4uint = OpTypeVector %uint 4 + %9 = OpConstantNull %v4uint +%_ptr_Function_v4uint = OpTypePointer Function %v4uint +%unused_entry_point = OpFunction %void None %1 + %4 = OpLabel + OpReturn + OpFunctionEnd + %f = OpFunction %void None %1 + %6 = OpLabel + %v = OpVariable %_ptr_Function_v4uint Function %9 + OpStore %v %9 + OpReturn + OpFunctionEnd diff --git a/test/expressions/zero_init/vec4/u32.wgsl.expected.wgsl b/test/expressions/zero_init/vec4/u32.wgsl.expected.wgsl new file mode 100644 index 0000000000..697b5e44f6 --- /dev/null +++ b/test/expressions/zero_init/vec4/u32.wgsl.expected.wgsl @@ -0,0 +1,3 @@ +fn f() { + var v = vec4(); +}