Add const-eval for `step`.

This CL adds const-eval for the `step` builtin.

Bug: tint:1581
Change-Id: Idbf773fb88892a8a5e620bcfe8b779dee148f746
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107281
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
diff --git a/src/tint/intrinsics.def b/src/tint/intrinsics.def
index c7123ba..01dd501 100644
--- a/src/tint/intrinsics.def
+++ b/src/tint/intrinsics.def
@@ -537,8 +537,8 @@
 fn smoothstep<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T>
 fn sqrt<T: f32_f16>(T) -> T
 fn sqrt<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
-fn step<T: f32_f16>(T, T) -> T
-fn step<N: num, T: f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T>
+@const fn step<T: fa_f32_f16>(T, T) -> T
+@const fn step<N: num, T: fa_f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T>
 @stage("compute") fn storageBarrier()
 fn tan<T: f32_f16>(T) -> T
 fn tan<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
diff --git a/src/tint/resolver/const_eval.cc b/src/tint/resolver/const_eval.cc
index 88748f1..1d0d333 100644
--- a/src/tint/resolver/const_eval.cc
+++ b/src/tint/resolver/const_eval.cc
@@ -1645,6 +1645,20 @@
     return TransformElements(builder, ty, transform, args[0], args[1]);
 }
 
+ConstEval::Result ConstEval::step(const sem::Type* ty,
+                                  utils::VectorRef<const sem::Constant*> args,
+                                  const Source&) {
+    auto transform = [&](const sem::Constant* c0, const sem::Constant* c1) {
+        auto create = [&](auto edge, auto x) -> ImplResult {
+            using NumberT = decltype(edge);
+            NumberT result = x.value < edge.value ? NumberT(0.0) : NumberT(1.0);
+            return CreateElement(builder, c0->Type(), result);
+        };
+        return Dispatch_fia_fiu32_f16(create, c0, c1);
+    };
+    return TransformElements(builder, ty, transform, args[0], args[1]);
+}
+
 ConstEval::Result ConstEval::Convert(const sem::Type* target_ty,
                                      const sem::Constant* value,
                                      const Source& source) {
diff --git a/src/tint/resolver/const_eval.h b/src/tint/resolver/const_eval.h
index 8d8eac7..425b524 100644
--- a/src/tint/resolver/const_eval.h
+++ b/src/tint/resolver/const_eval.h
@@ -449,6 +449,15 @@
                           utils::VectorRef<const sem::Constant*> args,
                           const Source& source);
 
+    /// step builtin
+    /// @param ty the expression type
+    /// @param args the input arguments
+    /// @param source the source location of the conversion
+    /// @return the result value, or null if the value cannot be calculated
+    Result step(const sem::Type* ty,
+                utils::VectorRef<const sem::Constant*> args,
+                const Source& source);
+
   private:
     /// Adds the given error message to the diagnostics
     void AddError(const std::string& msg, const Source& source) const;
diff --git a/src/tint/resolver/const_eval_builtin_test.cc b/src/tint/resolver/const_eval_builtin_test.cc
index cd7b82c..c35099e 100644
--- a/src/tint/resolver/const_eval_builtin_test.cc
+++ b/src/tint/resolver/const_eval_builtin_test.cc
@@ -506,5 +506,37 @@
                                               SelectCases<f16>(),
                                               SelectBoolCases()))));
 
+template <typename T>
+std::vector<Case> StepCases() {
+    return {
+        C({T(0), T(0)}, T(1.0)),
+        C({T(0), T(0.5)}, T(1.0)),
+        C({T(0.5), T(0)}, T(0.0)),
+        C({T(1), T(0.5)}, T(0.0)),
+        C({T(0.5), T(1)}, T(1.0)),
+        C({T(1.5), T(1)}, T(0.0)),
+        C({T(1), T(1.5)}, T(1.0)),
+        C({T(-1), T(1)}, T(1.0)),
+        C({T(-1), T(1)}, T(1.0)),
+        C({T(1), T(-1)}, T(0.0)),
+        C({T(-1), T(-1.5)}, T(0.0)),
+        C({T(-1.5), T(-1)}, T(1.0)),
+        C({T::Highest(), T::Lowest()}, T(0.0)),
+        C({T::Lowest(), T::Highest()}, T(1.0)),
+
+        // Vector tests
+        C({Vec(T(0), T(0)), Vec(T(0), T(0))}, Vec(T(1.0), T(1.0))),
+        C({Vec(T(-1), T(1)), Vec(T(0), T(0))}, Vec(T(1.0), T(0.0))),
+        C({Vec(T::Highest(), T::Lowest()), Vec(T::Lowest(), T::Highest())}, Vec(T(0.0), T(1.0))),
+    };
+}
+INSTANTIATE_TEST_SUITE_P(  //
+    Step,
+    ResolverConstEvalBuiltinTest,
+    testing::Combine(testing::Values(sem::BuiltinType::kStep),
+                     testing::ValuesIn(Concat(StepCases<AFloat>(),  //
+                                              StepCases<f32>(),
+                                              StepCases<f16>()))));
+
 }  // namespace
 }  // namespace tint::resolver
diff --git a/src/tint/resolver/intrinsic_table.inl b/src/tint/resolver/intrinsic_table.inl
index 96d52fd..785cce1 100644
--- a/src/tint/resolver/intrinsic_table.inl
+++ b/src/tint/resolver/intrinsic_table.inl
@@ -12575,24 +12575,24 @@
     /* num parameters */ 2,
     /* num template types */ 1,
     /* num template numbers */ 0,
-    /* template types */ &kTemplateTypes[25],
+    /* template types */ &kTemplateTypes[24],
     /* template numbers */ &kTemplateNumbers[10],
     /* parameters */ &kParameters[683],
     /* return matcher indices */ &kMatcherIndices[1],
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
-    /* const eval */ nullptr,
+    /* const eval */ &ConstEval::step,
   },
   {
     /* [355] */
     /* num parameters */ 2,
     /* num template types */ 1,
     /* num template numbers */ 1,
-    /* template types */ &kTemplateTypes[25],
+    /* template types */ &kTemplateTypes[24],
     /* template numbers */ &kTemplateNumbers[5],
     /* parameters */ &kParameters[681],
     /* return matcher indices */ &kMatcherIndices[30],
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
-    /* const eval */ nullptr,
+    /* const eval */ &ConstEval::step,
   },
   {
     /* [356] */
@@ -14477,8 +14477,8 @@
   },
   {
     /* [73] */
-    /* fn step<T : f32_f16>(T, T) -> T */
-    /* fn step<N : num, T : f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T> */
+    /* fn step<T : fa_f32_f16>(T, T) -> T */
+    /* fn step<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T> */
     /* num overloads */ 2,
     /* overloads */ &kOverloads[354],
   },
diff --git a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.dxc.hlsl
index ae74c4e..e1fa37e 100644
--- a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void step_07cb06() {
-  vector<float16_t, 2> res = step((float16_t(0.0h)).xx, (float16_t(0.0h)).xx);
+  vector<float16_t, 2> res = (float16_t(1.0h)).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.glsl
index fd5c470..de4bf1a 100644
--- a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void step_07cb06() {
-  f16vec2 res = step(f16vec2(0.0hf), f16vec2(0.0hf));
+  f16vec2 res = f16vec2(1.0hf);
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void step_07cb06() {
-  f16vec2 res = step(f16vec2(0.0hf), f16vec2(0.0hf));
+  f16vec2 res = f16vec2(1.0hf);
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void step_07cb06() {
-  f16vec2 res = step(f16vec2(0.0hf), f16vec2(0.0hf));
+  f16vec2 res = f16vec2(1.0hf);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.msl
index aa04803..8445f6f 100644
--- a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void step_07cb06() {
-  half2 res = step(half2(0.0h), half2(0.0h));
+  half2 res = half2(1.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.spvasm
index d73eed8..e4bc4cc 100644
--- a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.spvasm
@@ -8,7 +8,6 @@
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %16 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,15 +36,16 @@
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
-         %17 = OpConstantNull %v2half
+%half_0x1p_0 = OpConstant %half 0x1p+0
+         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
+         %19 = OpConstantNull %v2half
          %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %step_07cb06 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %17
-         %13 = OpExtInst %v2half %16 Step %17 %17
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_v2half Function %19
+               OpStore %res %16
                OpReturn
                OpFunctionEnd
 %vertex_main_inner = OpFunction %v4float None %20
diff --git a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.dxc.hlsl
index f899788..2d5a692 100644
--- a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void step_0b073b() {
-  float res = step(1.0f, 1.0f);
+  float res = 1.0f;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.fxc.hlsl
index f899788..2d5a692 100644
--- a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void step_0b073b() {
-  float res = step(1.0f, 1.0f);
+  float res = 1.0f;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.glsl
index 9e4ee8e..bdf7c88 100644
--- a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void step_0b073b() {
-  float res = step(1.0f, 1.0f);
+  float res = 1.0f;
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void step_0b073b() {
-  float res = step(1.0f, 1.0f);
+  float res = 1.0f;
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void step_0b073b() {
-  float res = step(1.0f, 1.0f);
+  float res = 1.0f;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.msl
index 7ab4a8e..021c79f 100644
--- a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void step_0b073b() {
-  float res = step(1.0f, 1.0f);
+  float res = 1.0f;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.spvasm
index df776a0..c6cadfe 100644
--- a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 29
 ; Schema: 0
                OpCapability Shader
-         %14 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -33,33 +32,32 @@
           %9 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %18 = OpTypeFunction %v4float
+         %16 = OpTypeFunction %v4float
 %step_0b073b = OpFunction %void None %9
          %12 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %13 = OpExtInst %float %14 Step %float_1 %float_1
-               OpStore %res %13
+               OpStore %res %float_1
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %step_0b073b
+%vertex_main_inner = OpFunction %v4float None %16
+         %18 = OpLabel
+         %19 = OpFunctionCall %void %step_0b073b
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+         %21 = OpLabel
+         %22 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %22
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %step_0b073b
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %step_0b073b
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %step_0b073b
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %step_0b073b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.dxc.hlsl
index e4d7e03..443da20 100644
--- a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void step_19accd() {
-  float2 res = step((1.0f).xx, (1.0f).xx);
+  float2 res = (1.0f).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.fxc.hlsl
index e4d7e03..443da20 100644
--- a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void step_19accd() {
-  float2 res = step((1.0f).xx, (1.0f).xx);
+  float2 res = (1.0f).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.glsl
index 282608b..c82ca8d 100644
--- a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void step_19accd() {
-  vec2 res = step(vec2(1.0f), vec2(1.0f));
+  vec2 res = vec2(1.0f);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void step_19accd() {
-  vec2 res = step(vec2(1.0f), vec2(1.0f));
+  vec2 res = vec2(1.0f);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void step_19accd() {
-  vec2 res = step(vec2(1.0f), vec2(1.0f));
+  vec2 res = vec2(1.0f);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.msl
index e77bffc..d774b45 100644
--- a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void step_19accd() {
-  float2 res = step(float2(1.0f), float2(1.0f));
+  float2 res = float2(1.0f);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.spvasm
index 05790d4..006fc96 100644
--- a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 32
 ; Schema: 0
                OpCapability Shader
-         %15 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -33,36 +32,35 @@
           %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %17 = OpConstantComposite %v2float %float_1 %float_1
+         %15 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %20 = OpConstantNull %v2float
-         %21 = OpTypeFunction %v4float
+         %18 = OpConstantNull %v2float
+         %19 = OpTypeFunction %v4float
 %step_19accd = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %20
-         %13 = OpExtInst %v2float %15 Step %17 %17
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_v2float Function %18
+               OpStore %res %15
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %step_19accd
+%vertex_main_inner = OpFunction %v4float None %19
+         %21 = OpLabel
+         %22 = OpFunctionCall %void %step_19accd
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+         %24 = OpLabel
+         %25 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %25
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %step_19accd
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %step_19accd
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %step_19accd
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %step_19accd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.dxc.hlsl
index 72b7a54..df39735 100644
--- a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void step_334303() {
-  float3 res = step((1.0f).xxx, (1.0f).xxx);
+  float3 res = (1.0f).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.fxc.hlsl
index 72b7a54..df39735 100644
--- a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void step_334303() {
-  float3 res = step((1.0f).xxx, (1.0f).xxx);
+  float3 res = (1.0f).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.glsl
index c5508ff..6ed30dd 100644
--- a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void step_334303() {
-  vec3 res = step(vec3(1.0f), vec3(1.0f));
+  vec3 res = vec3(1.0f);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void step_334303() {
-  vec3 res = step(vec3(1.0f), vec3(1.0f));
+  vec3 res = vec3(1.0f);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void step_334303() {
-  vec3 res = step(vec3(1.0f), vec3(1.0f));
+  vec3 res = vec3(1.0f);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.msl
index 7da6a2a..6a48828 100644
--- a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void step_334303() {
-  float3 res = step(float3(1.0f), float3(1.0f));
+  float3 res = float3(1.0f);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.spvasm
index e9513d6..895de97 100644
--- a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 32
 ; Schema: 0
                OpCapability Shader
-         %15 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -33,36 +32,35 @@
           %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %20 = OpConstantNull %v3float
-         %21 = OpTypeFunction %v4float
+         %18 = OpConstantNull %v3float
+         %19 = OpTypeFunction %v4float
 %step_334303 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %20
-         %13 = OpExtInst %v3float %15 Step %17 %17
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_v3float Function %18
+               OpStore %res %15
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %step_334303
+%vertex_main_inner = OpFunction %v4float None %19
+         %21 = OpLabel
+         %22 = OpFunctionCall %void %step_334303
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+         %24 = OpLabel
+         %25 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %25
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %step_334303
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %step_334303
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %step_334303
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %step_334303
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/38cd79.wgsl b/test/tint/builtins/gen/literal/step/38cd79.wgsl
new file mode 100644
index 0000000..c2ed3af
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/38cd79.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+//   test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn step(vec<4, fa>, vec<4, fa>) -> vec<4, fa>
+fn step_38cd79() {
+  var res = step(vec4(1), vec4(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_38cd79();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_38cd79();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_38cd79();
+}
diff --git a/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..defb919
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void step_38cd79() {
+  float4 res = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_38cd79();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_38cd79();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_38cd79();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..defb919
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void step_38cd79() {
+  float4 res = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_38cd79();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_38cd79();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_38cd79();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.glsl
new file mode 100644
index 0000000..bfcf13a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void step_38cd79() {
+  vec4 res = vec4(1.0f);
+}
+
+vec4 vertex_main() {
+  step_38cd79();
+  return vec4(0.0f);
+}
+
+void main() {
+  gl_PointSize = 1.0;
+  vec4 inner_result = vertex_main();
+  gl_Position = inner_result;
+  gl_Position.y = -(gl_Position.y);
+  gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+  return;
+}
+#version 310 es
+precision mediump float;
+
+void step_38cd79() {
+  vec4 res = vec4(1.0f);
+}
+
+void fragment_main() {
+  step_38cd79();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void step_38cd79() {
+  vec4 res = vec4(1.0f);
+}
+
+void compute_main() {
+  step_38cd79();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+  compute_main();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.msl
new file mode 100644
index 0000000..b828fcb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void step_38cd79() {
+  float4 res = float4(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  step_38cd79();
+  return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+  float4 const inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = {};
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+fragment void fragment_main() {
+  step_38cd79();
+  return;
+}
+
+kernel void compute_main() {
+  step_38cd79();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.spvasm
new file mode 100644
index 0000000..19b6160
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %step_38cd79 "step_38cd79"
+               OpName %res "res"
+               OpName %vertex_main_inner "vertex_main_inner"
+               OpName %vertex_main "vertex_main"
+               OpName %fragment_main "fragment_main"
+               OpName %compute_main "compute_main"
+               OpDecorate %value BuiltIn Position
+               OpDecorate %vertex_point_size BuiltIn PointSize
+      %float = OpTypeFloat 32
+    %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+          %5 = OpConstantNull %v4float
+      %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+          %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+       %void = OpTypeVoid
+          %9 = OpTypeFunction %void
+    %float_1 = OpConstant %float 1
+         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+         %17 = OpTypeFunction %v4float
+%step_38cd79 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %5
+               OpStore %res %14
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %17
+         %19 = OpLabel
+         %20 = OpFunctionCall %void %step_38cd79
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %22 = OpLabel
+         %23 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %23
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %step_38cd79
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %step_38cd79
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.wgsl
new file mode 100644
index 0000000..06dbd75
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/38cd79.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn step_38cd79() {
+  var res = step(vec4(1), vec4(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_38cd79();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_38cd79();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_38cd79();
+}
diff --git a/test/tint/builtins/gen/literal/step/415879.wgsl b/test/tint/builtins/gen/literal/step/415879.wgsl
new file mode 100644
index 0000000..0332e12
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/415879.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+//   test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn step(vec<3, fa>, vec<3, fa>) -> vec<3, fa>
+fn step_415879() {
+  var res = step(vec3(1), vec3(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_415879();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_415879();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_415879();
+}
diff --git a/test/tint/builtins/gen/literal/step/415879.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/415879.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f39b311
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/415879.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void step_415879() {
+  float3 res = (1.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_415879();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_415879();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_415879();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/step/415879.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/415879.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f39b311
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/415879.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void step_415879() {
+  float3 res = (1.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_415879();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_415879();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_415879();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/step/415879.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/415879.wgsl.expected.glsl
new file mode 100644
index 0000000..d276f82
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/415879.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void step_415879() {
+  vec3 res = vec3(1.0f);
+}
+
+vec4 vertex_main() {
+  step_415879();
+  return vec4(0.0f);
+}
+
+void main() {
+  gl_PointSize = 1.0;
+  vec4 inner_result = vertex_main();
+  gl_Position = inner_result;
+  gl_Position.y = -(gl_Position.y);
+  gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+  return;
+}
+#version 310 es
+precision mediump float;
+
+void step_415879() {
+  vec3 res = vec3(1.0f);
+}
+
+void fragment_main() {
+  step_415879();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void step_415879() {
+  vec3 res = vec3(1.0f);
+}
+
+void compute_main() {
+  step_415879();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+  compute_main();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/step/415879.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/415879.wgsl.expected.msl
new file mode 100644
index 0000000..b80ff31
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/415879.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void step_415879() {
+  float3 res = float3(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  step_415879();
+  return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+  float4 const inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = {};
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+fragment void fragment_main() {
+  step_415879();
+  return;
+}
+
+kernel void compute_main() {
+  step_415879();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/step/415879.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/415879.wgsl.expected.spvasm
new file mode 100644
index 0000000..7cad8bf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/415879.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %step_415879 "step_415879"
+               OpName %res "res"
+               OpName %vertex_main_inner "vertex_main_inner"
+               OpName %vertex_main "vertex_main"
+               OpName %fragment_main "fragment_main"
+               OpName %compute_main "compute_main"
+               OpDecorate %value BuiltIn Position
+               OpDecorate %vertex_point_size BuiltIn PointSize
+      %float = OpTypeFloat 32
+    %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+          %5 = OpConstantNull %v4float
+      %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+          %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+       %void = OpTypeVoid
+          %9 = OpTypeFunction %void
+    %v3float = OpTypeVector %float 3
+    %float_1 = OpConstant %float 1
+         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+         %18 = OpConstantNull %v3float
+         %19 = OpTypeFunction %v4float
+%step_415879 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %18
+               OpStore %res %15
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+         %21 = OpLabel
+         %22 = OpFunctionCall %void %step_415879
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %25
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %step_415879
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %step_415879
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/415879.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/step/415879.wgsl.expected.wgsl
new file mode 100644
index 0000000..37ed1f9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/415879.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn step_415879() {
+  var res = step(vec3(1), vec3(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_415879();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_415879();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_415879();
+}
diff --git a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.dxc.hlsl
index 0839e00..c7fbf20 100644
--- a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void step_630d07() {
-  float16_t res = step(float16_t(0.0h), float16_t(0.0h));
+  float16_t res = float16_t(1.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.glsl
index 7ddbf13..3d9d9b6 100644
--- a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void step_630d07() {
-  float16_t res = step(0.0hf, 0.0hf);
+  float16_t res = 1.0hf;
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void step_630d07() {
-  float16_t res = step(0.0hf, 0.0hf);
+  float16_t res = 1.0hf;
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void step_630d07() {
-  float16_t res = step(0.0hf, 0.0hf);
+  float16_t res = 1.0hf;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.msl
index ef616cf..2286127 100644
--- a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void step_630d07() {
-  half res = step(0.0h, 0.0h);
+  half res = 1.0h;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.spvasm
index 5783a90..cc87db9 100644
--- a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 32
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %15 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -36,36 +35,36 @@
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %16 = OpConstantNull %half
+%half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %19 = OpTypeFunction %v4float
+         %17 = OpConstantNull %half
+         %18 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %step_630d07 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %16
-         %13 = OpExtInst %half %15 Step %16 %16
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %half_0x1p_0
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %step_630d07
+%vertex_main_inner = OpFunction %v4float None %18
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %step_630d07
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+         %23 = OpLabel
+         %24 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %24
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %step_630d07
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %step_630d07
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %step_630d07
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %step_630d07
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/7c7e5c.wgsl b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl
new file mode 100644
index 0000000..8713980
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+//   test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn step(vec<2, fa>, vec<2, fa>) -> vec<2, fa>
+fn step_7c7e5c() {
+  var res = step(vec2(1), vec2(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_7c7e5c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_7c7e5c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_7c7e5c();
+}
diff --git a/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e34f6a01
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void step_7c7e5c() {
+  float2 res = (1.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_7c7e5c();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_7c7e5c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_7c7e5c();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e34f6a01
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void step_7c7e5c() {
+  float2 res = (1.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_7c7e5c();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_7c7e5c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_7c7e5c();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.glsl
new file mode 100644
index 0000000..2d91ea8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void step_7c7e5c() {
+  vec2 res = vec2(1.0f);
+}
+
+vec4 vertex_main() {
+  step_7c7e5c();
+  return vec4(0.0f);
+}
+
+void main() {
+  gl_PointSize = 1.0;
+  vec4 inner_result = vertex_main();
+  gl_Position = inner_result;
+  gl_Position.y = -(gl_Position.y);
+  gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+  return;
+}
+#version 310 es
+precision mediump float;
+
+void step_7c7e5c() {
+  vec2 res = vec2(1.0f);
+}
+
+void fragment_main() {
+  step_7c7e5c();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void step_7c7e5c() {
+  vec2 res = vec2(1.0f);
+}
+
+void compute_main() {
+  step_7c7e5c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+  compute_main();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.msl
new file mode 100644
index 0000000..cb9d6ee
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void step_7c7e5c() {
+  float2 res = float2(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  step_7c7e5c();
+  return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+  float4 const inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = {};
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+fragment void fragment_main() {
+  step_7c7e5c();
+  return;
+}
+
+kernel void compute_main() {
+  step_7c7e5c();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.spvasm
new file mode 100644
index 0000000..9695ced
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %step_7c7e5c "step_7c7e5c"
+               OpName %res "res"
+               OpName %vertex_main_inner "vertex_main_inner"
+               OpName %vertex_main "vertex_main"
+               OpName %fragment_main "fragment_main"
+               OpName %compute_main "compute_main"
+               OpDecorate %value BuiltIn Position
+               OpDecorate %vertex_point_size BuiltIn PointSize
+      %float = OpTypeFloat 32
+    %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+          %5 = OpConstantNull %v4float
+      %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+          %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+       %void = OpTypeVoid
+          %9 = OpTypeFunction %void
+    %v2float = OpTypeVector %float 2
+    %float_1 = OpConstant %float 1
+         %15 = OpConstantComposite %v2float %float_1 %float_1
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+         %18 = OpConstantNull %v2float
+         %19 = OpTypeFunction %v4float
+%step_7c7e5c = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %18
+               OpStore %res %15
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+         %21 = OpLabel
+         %22 = OpFunctionCall %void %step_7c7e5c
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %25
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %step_7c7e5c
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %step_7c7e5c
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.wgsl
new file mode 100644
index 0000000..8915183
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn step_7c7e5c() {
+  var res = step(vec2(1), vec2(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_7c7e5c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_7c7e5c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_7c7e5c();
+}
diff --git a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.dxc.hlsl
index 4f5992e..b441cea 100644
--- a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void step_baa320() {
-  vector<float16_t, 4> res = step((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx);
+  vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.glsl
index 37f8212..a255127 100644
--- a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void step_baa320() {
-  f16vec4 res = step(f16vec4(0.0hf), f16vec4(0.0hf));
+  f16vec4 res = f16vec4(1.0hf);
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void step_baa320() {
-  f16vec4 res = step(f16vec4(0.0hf), f16vec4(0.0hf));
+  f16vec4 res = f16vec4(1.0hf);
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void step_baa320() {
-  f16vec4 res = step(f16vec4(0.0hf), f16vec4(0.0hf));
+  f16vec4 res = f16vec4(1.0hf);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.msl
index ea8bc33..ef04a5d 100644
--- a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void step_baa320() {
-  half4 res = step(half4(0.0h), half4(0.0h));
+  half4 res = half4(1.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.spvasm
index 492cd3f7..fe1262f 100644
--- a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.spvasm
@@ -8,7 +8,6 @@
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %16 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,15 +36,16 @@
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
-         %17 = OpConstantNull %v4half
+%half_0x1p_0 = OpConstant %half 0x1p+0
+         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
+         %19 = OpConstantNull %v4half
          %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %step_baa320 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %17
-         %13 = OpExtInst %v4half %16 Step %17 %17
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_v4half Function %19
+               OpStore %res %16
                OpReturn
                OpFunctionEnd
 %vertex_main_inner = OpFunction %v4float None %20
diff --git a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.dxc.hlsl
index d4a6c36..6a9b0cf 100644
--- a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void step_cc6b61() {
-  vector<float16_t, 3> res = step((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx);
+  vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.glsl
index 0cb5d43..13727a2 100644
--- a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void step_cc6b61() {
-  f16vec3 res = step(f16vec3(0.0hf), f16vec3(0.0hf));
+  f16vec3 res = f16vec3(1.0hf);
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void step_cc6b61() {
-  f16vec3 res = step(f16vec3(0.0hf), f16vec3(0.0hf));
+  f16vec3 res = f16vec3(1.0hf);
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void step_cc6b61() {
-  f16vec3 res = step(f16vec3(0.0hf), f16vec3(0.0hf));
+  f16vec3 res = f16vec3(1.0hf);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.msl
index 4e65712..8916aa5 100644
--- a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void step_cc6b61() {
-  half3 res = step(half3(0.0h), half3(0.0h));
+  half3 res = half3(1.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.spvasm
index 8e2e6b9..85451a0 100644
--- a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.spvasm
@@ -8,7 +8,6 @@
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %16 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,15 +36,16 @@
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
-         %17 = OpConstantNull %v3half
+%half_0x1p_0 = OpConstant %half 0x1p+0
+         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
+         %19 = OpConstantNull %v3half
          %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %step_cc6b61 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %17
-         %13 = OpExtInst %v3half %16 Step %17 %17
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_v3half Function %19
+               OpStore %res %16
                OpReturn
                OpFunctionEnd
 %vertex_main_inner = OpFunction %v4float None %20
diff --git a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.dxc.hlsl
index e9b4b3a..64ad9a1 100644
--- a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void step_e2b337() {
-  float4 res = step((1.0f).xxxx, (1.0f).xxxx);
+  float4 res = (1.0f).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.fxc.hlsl
index e9b4b3a..64ad9a1 100644
--- a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void step_e2b337() {
-  float4 res = step((1.0f).xxxx, (1.0f).xxxx);
+  float4 res = (1.0f).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.glsl
index 30481fc..0349224 100644
--- a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void step_e2b337() {
-  vec4 res = step(vec4(1.0f), vec4(1.0f));
+  vec4 res = vec4(1.0f);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void step_e2b337() {
-  vec4 res = step(vec4(1.0f), vec4(1.0f));
+  vec4 res = vec4(1.0f);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void step_e2b337() {
-  vec4 res = step(vec4(1.0f), vec4(1.0f));
+  vec4 res = vec4(1.0f);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.msl
index 8d56ad4..7be704f 100644
--- a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void step_e2b337() {
-  float4 res = step(float4(1.0f), float4(1.0f));
+  float4 res = float4(1.0f);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.spvasm
index debffef..b70e650 100644
--- a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 30
 ; Schema: 0
                OpCapability Shader
-         %14 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -32,35 +31,34 @@
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %19 = OpTypeFunction %v4float
+         %17 = OpTypeFunction %v4float
 %step_e2b337 = OpFunction %void None %9
          %12 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %13 = OpExtInst %v4float %14 Step %16 %16
-               OpStore %res %13
+               OpStore %res %14
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %step_e2b337
+%vertex_main_inner = OpFunction %v4float None %17
+         %19 = OpLabel
+         %20 = OpFunctionCall %void %step_e2b337
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+         %22 = OpLabel
+         %23 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %23
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %step_e2b337
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %step_e2b337
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %step_e2b337
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %step_e2b337
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/f9b70c.wgsl b/test/tint/builtins/gen/literal/step/f9b70c.wgsl
new file mode 100644
index 0000000..71339b0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/f9b70c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+//   test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn step(fa, fa) -> fa
+fn step_f9b70c() {
+  var res = step(1, 1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_f9b70c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_f9b70c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_f9b70c();
+}
diff --git a/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..64432f4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void step_f9b70c() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_f9b70c();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_f9b70c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_f9b70c();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..64432f4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void step_f9b70c() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_f9b70c();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_f9b70c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_f9b70c();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.glsl
new file mode 100644
index 0000000..5a98ba9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void step_f9b70c() {
+  float res = 1.0f;
+}
+
+vec4 vertex_main() {
+  step_f9b70c();
+  return vec4(0.0f);
+}
+
+void main() {
+  gl_PointSize = 1.0;
+  vec4 inner_result = vertex_main();
+  gl_Position = inner_result;
+  gl_Position.y = -(gl_Position.y);
+  gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+  return;
+}
+#version 310 es
+precision mediump float;
+
+void step_f9b70c() {
+  float res = 1.0f;
+}
+
+void fragment_main() {
+  step_f9b70c();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void step_f9b70c() {
+  float res = 1.0f;
+}
+
+void compute_main() {
+  step_f9b70c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+  compute_main();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.msl
new file mode 100644
index 0000000..67982e1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void step_f9b70c() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  step_f9b70c();
+  return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+  float4 const inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = {};
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+fragment void fragment_main() {
+  step_f9b70c();
+  return;
+}
+
+kernel void compute_main() {
+  step_f9b70c();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.spvasm
new file mode 100644
index 0000000..f3d0c08
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %step_f9b70c "step_f9b70c"
+               OpName %res "res"
+               OpName %vertex_main_inner "vertex_main_inner"
+               OpName %vertex_main "vertex_main"
+               OpName %fragment_main "fragment_main"
+               OpName %compute_main "compute_main"
+               OpDecorate %value BuiltIn Position
+               OpDecorate %vertex_point_size BuiltIn PointSize
+      %float = OpTypeFloat 32
+    %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+          %5 = OpConstantNull %v4float
+      %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+          %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+       %void = OpTypeVoid
+          %9 = OpTypeFunction %void
+    %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+         %16 = OpTypeFunction %v4float
+%step_f9b70c = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %8
+               OpStore %res %float_1
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+         %18 = OpLabel
+         %19 = OpFunctionCall %void %step_f9b70c
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %21 = OpLabel
+         %22 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %22
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %step_f9b70c
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %step_f9b70c
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.wgsl
new file mode 100644
index 0000000..bf04295
--- /dev/null
+++ b/test/tint/builtins/gen/literal/step/f9b70c.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn step_f9b70c() {
+  var res = step(1, 1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_f9b70c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_f9b70c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_f9b70c();
+}
diff --git a/test/tint/builtins/gen/var/step/38cd79.wgsl b/test/tint/builtins/gen/var/step/38cd79.wgsl
new file mode 100644
index 0000000..ca5eb21
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/38cd79.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+//   test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn step(vec<4, fa>, vec<4, fa>) -> vec<4, fa>
+fn step_38cd79() {
+  const arg_0 = vec4(1);
+  const arg_1 = vec4(1);
+  var res = step(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_38cd79();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_38cd79();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_38cd79();
+}
diff --git a/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..defb919
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void step_38cd79() {
+  float4 res = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_38cd79();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_38cd79();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_38cd79();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..defb919
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void step_38cd79() {
+  float4 res = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_38cd79();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_38cd79();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_38cd79();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.glsl b/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.glsl
new file mode 100644
index 0000000..bfcf13a
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void step_38cd79() {
+  vec4 res = vec4(1.0f);
+}
+
+vec4 vertex_main() {
+  step_38cd79();
+  return vec4(0.0f);
+}
+
+void main() {
+  gl_PointSize = 1.0;
+  vec4 inner_result = vertex_main();
+  gl_Position = inner_result;
+  gl_Position.y = -(gl_Position.y);
+  gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+  return;
+}
+#version 310 es
+precision mediump float;
+
+void step_38cd79() {
+  vec4 res = vec4(1.0f);
+}
+
+void fragment_main() {
+  step_38cd79();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void step_38cd79() {
+  vec4 res = vec4(1.0f);
+}
+
+void compute_main() {
+  step_38cd79();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+  compute_main();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.msl b/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.msl
new file mode 100644
index 0000000..b828fcb
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void step_38cd79() {
+  float4 res = float4(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  step_38cd79();
+  return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+  float4 const inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = {};
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+fragment void fragment_main() {
+  step_38cd79();
+  return;
+}
+
+kernel void compute_main() {
+  step_38cd79();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.spvasm b/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.spvasm
new file mode 100644
index 0000000..19b6160
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %step_38cd79 "step_38cd79"
+               OpName %res "res"
+               OpName %vertex_main_inner "vertex_main_inner"
+               OpName %vertex_main "vertex_main"
+               OpName %fragment_main "fragment_main"
+               OpName %compute_main "compute_main"
+               OpDecorate %value BuiltIn Position
+               OpDecorate %vertex_point_size BuiltIn PointSize
+      %float = OpTypeFloat 32
+    %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+          %5 = OpConstantNull %v4float
+      %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+          %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+       %void = OpTypeVoid
+          %9 = OpTypeFunction %void
+    %float_1 = OpConstant %float 1
+         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+         %17 = OpTypeFunction %v4float
+%step_38cd79 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %5
+               OpStore %res %14
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %17
+         %19 = OpLabel
+         %20 = OpFunctionCall %void %step_38cd79
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %22 = OpLabel
+         %23 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %23
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %step_38cd79
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %step_38cd79
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.wgsl b/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.wgsl
new file mode 100644
index 0000000..852b4e3
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/38cd79.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+fn step_38cd79() {
+  const arg_0 = vec4(1);
+  const arg_1 = vec4(1);
+  var res = step(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_38cd79();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_38cd79();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_38cd79();
+}
diff --git a/test/tint/builtins/gen/var/step/415879.wgsl b/test/tint/builtins/gen/var/step/415879.wgsl
new file mode 100644
index 0000000..6d51afa
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/415879.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+//   test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn step(vec<3, fa>, vec<3, fa>) -> vec<3, fa>
+fn step_415879() {
+  const arg_0 = vec3(1);
+  const arg_1 = vec3(1);
+  var res = step(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_415879();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_415879();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_415879();
+}
diff --git a/test/tint/builtins/gen/var/step/415879.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/step/415879.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f39b311
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/415879.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void step_415879() {
+  float3 res = (1.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_415879();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_415879();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_415879();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/step/415879.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/step/415879.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f39b311
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/415879.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void step_415879() {
+  float3 res = (1.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_415879();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_415879();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_415879();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/step/415879.wgsl.expected.glsl b/test/tint/builtins/gen/var/step/415879.wgsl.expected.glsl
new file mode 100644
index 0000000..d276f82
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/415879.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void step_415879() {
+  vec3 res = vec3(1.0f);
+}
+
+vec4 vertex_main() {
+  step_415879();
+  return vec4(0.0f);
+}
+
+void main() {
+  gl_PointSize = 1.0;
+  vec4 inner_result = vertex_main();
+  gl_Position = inner_result;
+  gl_Position.y = -(gl_Position.y);
+  gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+  return;
+}
+#version 310 es
+precision mediump float;
+
+void step_415879() {
+  vec3 res = vec3(1.0f);
+}
+
+void fragment_main() {
+  step_415879();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void step_415879() {
+  vec3 res = vec3(1.0f);
+}
+
+void compute_main() {
+  step_415879();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+  compute_main();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/step/415879.wgsl.expected.msl b/test/tint/builtins/gen/var/step/415879.wgsl.expected.msl
new file mode 100644
index 0000000..b80ff31
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/415879.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void step_415879() {
+  float3 res = float3(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  step_415879();
+  return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+  float4 const inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = {};
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+fragment void fragment_main() {
+  step_415879();
+  return;
+}
+
+kernel void compute_main() {
+  step_415879();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/step/415879.wgsl.expected.spvasm b/test/tint/builtins/gen/var/step/415879.wgsl.expected.spvasm
new file mode 100644
index 0000000..7cad8bf
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/415879.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %step_415879 "step_415879"
+               OpName %res "res"
+               OpName %vertex_main_inner "vertex_main_inner"
+               OpName %vertex_main "vertex_main"
+               OpName %fragment_main "fragment_main"
+               OpName %compute_main "compute_main"
+               OpDecorate %value BuiltIn Position
+               OpDecorate %vertex_point_size BuiltIn PointSize
+      %float = OpTypeFloat 32
+    %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+          %5 = OpConstantNull %v4float
+      %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+          %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+       %void = OpTypeVoid
+          %9 = OpTypeFunction %void
+    %v3float = OpTypeVector %float 3
+    %float_1 = OpConstant %float 1
+         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+         %18 = OpConstantNull %v3float
+         %19 = OpTypeFunction %v4float
+%step_415879 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %18
+               OpStore %res %15
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+         %21 = OpLabel
+         %22 = OpFunctionCall %void %step_415879
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %25
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %step_415879
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %step_415879
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/step/415879.wgsl.expected.wgsl b/test/tint/builtins/gen/var/step/415879.wgsl.expected.wgsl
new file mode 100644
index 0000000..a44fd51
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/415879.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+fn step_415879() {
+  const arg_0 = vec3(1);
+  const arg_1 = vec3(1);
+  var res = step(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_415879();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_415879();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_415879();
+}
diff --git a/test/tint/builtins/gen/var/step/7c7e5c.wgsl b/test/tint/builtins/gen/var/step/7c7e5c.wgsl
new file mode 100644
index 0000000..60953e1
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/7c7e5c.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+//   test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn step(vec<2, fa>, vec<2, fa>) -> vec<2, fa>
+fn step_7c7e5c() {
+  const arg_0 = vec2(1);
+  const arg_1 = vec2(1);
+  var res = step(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_7c7e5c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_7c7e5c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_7c7e5c();
+}
diff --git a/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e34f6a01
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void step_7c7e5c() {
+  float2 res = (1.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_7c7e5c();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_7c7e5c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_7c7e5c();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e34f6a01
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void step_7c7e5c() {
+  float2 res = (1.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_7c7e5c();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_7c7e5c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_7c7e5c();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.glsl b/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.glsl
new file mode 100644
index 0000000..2d91ea8
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void step_7c7e5c() {
+  vec2 res = vec2(1.0f);
+}
+
+vec4 vertex_main() {
+  step_7c7e5c();
+  return vec4(0.0f);
+}
+
+void main() {
+  gl_PointSize = 1.0;
+  vec4 inner_result = vertex_main();
+  gl_Position = inner_result;
+  gl_Position.y = -(gl_Position.y);
+  gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+  return;
+}
+#version 310 es
+precision mediump float;
+
+void step_7c7e5c() {
+  vec2 res = vec2(1.0f);
+}
+
+void fragment_main() {
+  step_7c7e5c();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void step_7c7e5c() {
+  vec2 res = vec2(1.0f);
+}
+
+void compute_main() {
+  step_7c7e5c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+  compute_main();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.msl b/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.msl
new file mode 100644
index 0000000..cb9d6ee
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void step_7c7e5c() {
+  float2 res = float2(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  step_7c7e5c();
+  return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+  float4 const inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = {};
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+fragment void fragment_main() {
+  step_7c7e5c();
+  return;
+}
+
+kernel void compute_main() {
+  step_7c7e5c();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.spvasm
new file mode 100644
index 0000000..9695ced
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %step_7c7e5c "step_7c7e5c"
+               OpName %res "res"
+               OpName %vertex_main_inner "vertex_main_inner"
+               OpName %vertex_main "vertex_main"
+               OpName %fragment_main "fragment_main"
+               OpName %compute_main "compute_main"
+               OpDecorate %value BuiltIn Position
+               OpDecorate %vertex_point_size BuiltIn PointSize
+      %float = OpTypeFloat 32
+    %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+          %5 = OpConstantNull %v4float
+      %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+          %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+       %void = OpTypeVoid
+          %9 = OpTypeFunction %void
+    %v2float = OpTypeVector %float 2
+    %float_1 = OpConstant %float 1
+         %15 = OpConstantComposite %v2float %float_1 %float_1
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+         %18 = OpConstantNull %v2float
+         %19 = OpTypeFunction %v4float
+%step_7c7e5c = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %18
+               OpStore %res %15
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+         %21 = OpLabel
+         %22 = OpFunctionCall %void %step_7c7e5c
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %25
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %step_7c7e5c
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %step_7c7e5c
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.wgsl
new file mode 100644
index 0000000..c913fb9
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/7c7e5c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+fn step_7c7e5c() {
+  const arg_0 = vec2(1);
+  const arg_1 = vec2(1);
+  var res = step(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_7c7e5c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_7c7e5c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_7c7e5c();
+}
diff --git a/test/tint/builtins/gen/var/step/f9b70c.wgsl b/test/tint/builtins/gen/var/step/f9b70c.wgsl
new file mode 100644
index 0000000..422c765
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/f9b70c.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+//   test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn step(fa, fa) -> fa
+fn step_f9b70c() {
+  const arg_0 = 1;
+  const arg_1 = 1;
+  var res = step(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_f9b70c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_f9b70c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_f9b70c();
+}
diff --git a/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..64432f4
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void step_f9b70c() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_f9b70c();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_f9b70c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_f9b70c();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..64432f4
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void step_f9b70c() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  step_f9b70c();
+  return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+  const float4 inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = (tint_symbol)0;
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+void fragment_main() {
+  step_f9b70c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  step_f9b70c();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.glsl b/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.glsl
new file mode 100644
index 0000000..5a98ba9
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void step_f9b70c() {
+  float res = 1.0f;
+}
+
+vec4 vertex_main() {
+  step_f9b70c();
+  return vec4(0.0f);
+}
+
+void main() {
+  gl_PointSize = 1.0;
+  vec4 inner_result = vertex_main();
+  gl_Position = inner_result;
+  gl_Position.y = -(gl_Position.y);
+  gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+  return;
+}
+#version 310 es
+precision mediump float;
+
+void step_f9b70c() {
+  float res = 1.0f;
+}
+
+void fragment_main() {
+  step_f9b70c();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void step_f9b70c() {
+  float res = 1.0f;
+}
+
+void compute_main() {
+  step_f9b70c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+  compute_main();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.msl b/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.msl
new file mode 100644
index 0000000..67982e1
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void step_f9b70c() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  step_f9b70c();
+  return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+  float4 const inner_result = vertex_main_inner();
+  tint_symbol wrapper_result = {};
+  wrapper_result.value = inner_result;
+  return wrapper_result;
+}
+
+fragment void fragment_main() {
+  step_f9b70c();
+  return;
+}
+
+kernel void compute_main() {
+  step_f9b70c();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.spvasm
new file mode 100644
index 0000000..f3d0c08
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %step_f9b70c "step_f9b70c"
+               OpName %res "res"
+               OpName %vertex_main_inner "vertex_main_inner"
+               OpName %vertex_main "vertex_main"
+               OpName %fragment_main "fragment_main"
+               OpName %compute_main "compute_main"
+               OpDecorate %value BuiltIn Position
+               OpDecorate %vertex_point_size BuiltIn PointSize
+      %float = OpTypeFloat 32
+    %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+          %5 = OpConstantNull %v4float
+      %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+          %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+       %void = OpTypeVoid
+          %9 = OpTypeFunction %void
+    %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+         %16 = OpTypeFunction %v4float
+%step_f9b70c = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %8
+               OpStore %res %float_1
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+         %18 = OpLabel
+         %19 = OpFunctionCall %void %step_f9b70c
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %21 = OpLabel
+         %22 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %22
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %step_f9b70c
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %step_f9b70c
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.wgsl
new file mode 100644
index 0000000..4222282
--- /dev/null
+++ b/test/tint/builtins/gen/var/step/f9b70c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+fn step_f9b70c() {
+  const arg_0 = 1;
+  const arg_1 = 1;
+  var res = step(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  step_f9b70c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  step_f9b70c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  step_f9b70c();
+}