Implement const eval of `abs`

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

Bug: tint:1581
Change-Id: I6ee25c07620990f72a6962441aec62ae7665653e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108340
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/tint/intrinsics.def b/src/tint/intrinsics.def
index 6bf8553..72a537f 100644
--- a/src/tint/intrinsics.def
+++ b/src/tint/intrinsics.def
@@ -404,8 +404,8 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 // https://gpuweb.github.io/gpuweb/wgsl/#builtin-functions
-fn abs<T: fiu32_f16>(T) -> T
-fn abs<N: num, T: fiu32_f16>(vec<N, T>) -> vec<N, T>
+@const fn abs<T: fia_fiu32_f16>(T) -> T
+@const fn abs<N: num, T: fia_fiu32_f16>(vec<N, T>) -> vec<N, T>
 fn acos<T: f32_f16>(T) -> T
 fn acos<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
 fn acosh<T: f32_f16>(T) -> T
diff --git a/src/tint/resolver/builtin_test.cc b/src/tint/resolver/builtin_test.cc
index 7c15767..c3911fb 100644
--- a/src/tint/resolver/builtin_test.cc
+++ b/src/tint/resolver/builtin_test.cc
@@ -61,12 +61,10 @@
 }
 
 TEST_F(ResolverBuiltinTest, ModuleScopeUsage) {
-    GlobalConst("c", ty.f32(), Call(Source{{12, 34}}, "abs", 1._f));
+    GlobalConst("c", ty.f32(), Call(Source{{12, 34}}, "dpdy", 1._f));
 
     EXPECT_FALSE(r()->Resolve());
 
-    // TODO(crbug.com/tint/1581): Once 'abs' is implemented as @const, this will no longer be an
-    // error.
     EXPECT_EQ(
         r()->error(),
         R"(12:34 error: const initializer requires a const-expression, but expression is a runtime-expression)");
diff --git a/src/tint/resolver/const_eval.cc b/src/tint/resolver/const_eval.cc
index c94ed3b..2795517 100644
--- a/src/tint/resolver/const_eval.cc
+++ b/src/tint/resolver/const_eval.cc
@@ -1570,6 +1570,31 @@
     return r;
 }
 
+ConstEval::Result ConstEval::abs(const sem::Type* ty,
+                                 utils::VectorRef<const sem::Constant*> args,
+                                 const Source&) {
+    auto transform = [&](const sem::Constant* c0) {
+        auto create = [&](auto e) {
+            using NumberT = decltype(e);
+            NumberT result;
+            if constexpr (IsUnsignedIntegral<NumberT>) {
+                result = e;
+            } else if constexpr (IsSignedIntegral<NumberT>) {
+                if (e == NumberT::Lowest()) {
+                    result = e;
+                } else {
+                    result = NumberT{std::abs(e)};
+                }
+            } else {
+                result = NumberT{std::abs(e)};
+            }
+            return CreateElement(builder, c0->Type(), result);
+        };
+        return Dispatch_fia_fiu32_f16(create, c0);
+    };
+    return TransformElements(builder, ty, transform, args[0]);
+}
+
 ConstEval::Result ConstEval::all(const sem::Type* ty,
                                  utils::VectorRef<const sem::Constant*> args,
                                  const Source&) {
diff --git a/src/tint/resolver/const_eval.h b/src/tint/resolver/const_eval.h
index 1fd7412..6337988 100644
--- a/src/tint/resolver/const_eval.h
+++ b/src/tint/resolver/const_eval.h
@@ -377,6 +377,15 @@
     // Builtins
     ////////////////////////////////////////////////////////////////////////////
 
+    /// abs 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 abs(const sem::Type* ty,
+               utils::VectorRef<const sem::Constant*> args,
+               const Source& source);
+
     /// all builtin
     /// @param ty the expression type
     /// @param args the input arguments
diff --git a/src/tint/resolver/const_eval_builtin_test.cc b/src/tint/resolver/const_eval_builtin_test.cc
index 7496214..26ab4fa 100644
--- a/src/tint/resolver/const_eval_builtin_test.cc
+++ b/src/tint/resolver/const_eval_builtin_test.cc
@@ -146,6 +146,53 @@
                          C({1.0_a, 0_a}, kPiOver2<AFloat>),
                      })));
 
+template <typename T, bool finite_only>
+std::vector<Case> AbsCases() {
+    std::vector<Case> cases = {
+        C({T(0)}, T(0)),
+        C({T(2.0)}, T(2.0)),
+        C({T::Highest()}, T::Highest()),
+
+        // Vector tests
+        C({Vec(T(2.0), T::Highest())}, Vec(T(2.0), T::Highest())),
+    };
+
+    ConcatIntoIf<IsSignedIntegral<T>>(
+        cases,
+        std::vector<Case>{
+            C({Negate(T(0))}, T(0)),
+            C({Negate(T(2.0))}, T(2.0)),
+            // If e is signed and is the largest negative, the result is e
+            C({T::Lowest()}, T::Lowest()),
+
+            // 1 more then min i32
+            C({Negate(T(2147483647))}, T(2147483647)),
+
+            C({Vec(T(0), Negate(T(0)))}, Vec(T(0), T(0))),
+            C({Vec(Negate(T(2.0)), T(2.0), T::Highest())}, Vec(T(2.0), T(2.0), T::Highest())),
+        });
+
+    ConcatIntoIf<!finite_only>(cases, std::vector<Case>{
+                                          C({Negate(T::Inf())}, T::Inf()),
+                                          C({T::Inf()}, T::Inf()),
+                                          C({T::NaN()}, T::NaN()),
+                                          C({Vec(Negate(T::Inf()), T::Inf(), T::NaN())},
+                                            Vec(T::Inf(), T::Inf(), T::NaN())),
+                                      });
+
+    return cases;
+}
+INSTANTIATE_TEST_SUITE_P(  //
+    Abs,
+    ResolverConstEvalBuiltinTest,
+    testing::Combine(testing::Values(sem::BuiltinType::kAbs),
+                     testing::ValuesIn(Concat(AbsCases<AInt, false>(),  //
+                                              AbsCases<i32, false>(),
+                                              AbsCases<u32, false>(),
+                                              AbsCases<AFloat, true>(),
+                                              AbsCases<f32, false>(),
+                                              AbsCases<f16, false>()))));
+
 static std::vector<Case> AllCases() {
     return {
         C({Val(true)}, Val(true)),
diff --git a/src/tint/resolver/intrinsic_table.inl b/src/tint/resolver/intrinsic_table.inl
index f8dbd43..2109cf4 100644
--- a/src/tint/resolver/intrinsic_table.inl
+++ b/src/tint/resolver/intrinsic_table.inl
@@ -12945,24 +12945,24 @@
     /* num parameters */ 1,
     /* num template types */ 1,
     /* num template numbers */ 0,
-    /* template types */ &kTemplateTypes[25],
+    /* template types */ &kTemplateTypes[28],
     /* template numbers */ &kTemplateNumbers[10],
     /* parameters */ &kParameters[1018],
     /* return matcher indices */ &kMatcherIndices[1],
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
-    /* const eval */ nullptr,
+    /* const eval */ &ConstEval::abs,
   },
   {
     /* [385] */
     /* num parameters */ 1,
     /* num template types */ 1,
     /* num template numbers */ 1,
-    /* template types */ &kTemplateTypes[25],
+    /* template types */ &kTemplateTypes[28],
     /* template numbers */ &kTemplateNumbers[6],
     /* parameters */ &kParameters[853],
     /* return matcher indices */ &kMatcherIndices[30],
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
-    /* const eval */ nullptr,
+    /* const eval */ &ConstEval::abs,
   },
   {
     /* [386] */
@@ -14013,8 +14013,8 @@
 constexpr IntrinsicInfo kBuiltins[] = {
   {
     /* [0] */
-    /* fn abs<T : fiu32_f16>(T) -> T */
-    /* fn abs<N : num, T : fiu32_f16>(vec<N, T>) -> vec<N, T> */
+    /* fn abs<T : fia_fiu32_f16>(T) -> T */
+    /* fn abs<N : num, T : fia_fiu32_f16>(vec<N, T>) -> vec<N, T> */
     /* num overloads */ 2,
     /* overloads */ &kOverloads[384],
   },
diff --git a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.dxc.hlsl
index 478b532..622f6b4 100644
--- a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_002533() {
-  float4 res = abs((1.0f).xxxx);
+  float4 res = (1.0f).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.fxc.hlsl
index 478b532..622f6b4 100644
--- a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void abs_002533() {
-  float4 res = abs((1.0f).xxxx);
+  float4 res = (1.0f).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.glsl
index 2e7bac5..95596b7 100644
--- a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void abs_002533() {
-  vec4 res = abs(vec4(1.0f));
+  vec4 res = vec4(1.0f);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void abs_002533() {
-  vec4 res = abs(vec4(1.0f));
+  vec4 res = vec4(1.0f);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void abs_002533() {
-  vec4 res = abs(vec4(1.0f));
+  vec4 res = vec4(1.0f);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.msl
index f9acb2d..149ee71 100644
--- a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_002533() {
-  float4 res = fabs(float4(1.0f));
+  float4 res = float4(1.0f);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.spvasm
index 432dad0..b4a5d21 100644
--- a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/002533.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
  %abs_002533 = OpFunction %void None %9
          %12 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %13 = OpExtInst %v4float %14 FAbs %16
-               OpStore %res %13
+               OpStore %res %14
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %abs_002533
+%vertex_main_inner = OpFunction %v4float None %17
+         %19 = OpLabel
+         %20 = OpFunctionCall %void %abs_002533
                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 %abs_002533
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %abs_002533
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %abs_002533
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %abs_002533
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.dxc.hlsl
index 083f7d1..fb1822b 100644
--- a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_005174() {
-  float3 res = abs((1.0f).xxx);
+  float3 res = (1.0f).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.fxc.hlsl
index 083f7d1..fb1822b 100644
--- a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void abs_005174() {
-  float3 res = abs((1.0f).xxx);
+  float3 res = (1.0f).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.glsl
index e1c3952..f77f7d7 100644
--- a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void abs_005174() {
-  vec3 res = abs(vec3(1.0f));
+  vec3 res = vec3(1.0f);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void abs_005174() {
-  vec3 res = abs(vec3(1.0f));
+  vec3 res = vec3(1.0f);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void abs_005174() {
-  vec3 res = abs(vec3(1.0f));
+  vec3 res = vec3(1.0f);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.msl
index 91163ee..a5fdf30 100644
--- a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_005174() {
-  float3 res = fabs(float3(1.0f));
+  float3 res = float3(1.0f);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.spvasm
index e1fc03a..5b19784 100644
--- a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/005174.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
  %abs_005174 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %20
-         %13 = OpExtInst %v3float %15 FAbs %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 %abs_005174
+%vertex_main_inner = OpFunction %v4float None %19
+         %21 = OpLabel
+         %22 = OpFunctionCall %void %abs_005174
                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 %abs_005174
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_005174
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_005174
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_005174
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.dxc.hlsl
index 6b8b5ac..426d5a9 100644
--- a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_1ce782() {
-  uint4 res = abs((1u).xxxx);
+  uint4 res = (1u).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.fxc.hlsl
index 6b8b5ac..426d5a9 100644
--- a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void abs_1ce782() {
-  uint4 res = abs((1u).xxxx);
+  uint4 res = (1u).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.msl
index 007f709..2284b5e 100644
--- a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_1ce782() {
-  uint4 res = abs(uint4(1u));
+  uint4 res = uint4(1u);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.spvasm
index 5ae24ba..1a58d40 100644
--- a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -33,36 +33,36 @@
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
      %uint_1 = OpConstant %uint 1
-         %17 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %20 = OpConstantNull %v4uint
-         %21 = OpTypeFunction %v4float
+         %19 = OpConstantNull %v4uint
+         %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
  %abs_1ce782 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %20
-               OpStore %res %17
+        %res = OpVariable %_ptr_Function_v4uint Function %19
+               OpStore %res %16
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %abs_1ce782
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %abs_1ce782
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+         %25 = OpLabel
+         %26 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %26
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %abs_1ce782
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_1ce782
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %abs_1ce782
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_1ce782
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.dxc.hlsl
index f0c45a3..e69b529 100644
--- a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_1e9d53() {
-  float2 res = abs((1.0f).xx);
+  float2 res = (1.0f).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.fxc.hlsl
index f0c45a3..e69b529 100644
--- a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void abs_1e9d53() {
-  float2 res = abs((1.0f).xx);
+  float2 res = (1.0f).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.glsl
index 1f6f521..e3de90e 100644
--- a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void abs_1e9d53() {
-  vec2 res = abs(vec2(1.0f));
+  vec2 res = vec2(1.0f);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void abs_1e9d53() {
-  vec2 res = abs(vec2(1.0f));
+  vec2 res = vec2(1.0f);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void abs_1e9d53() {
-  vec2 res = abs(vec2(1.0f));
+  vec2 res = vec2(1.0f);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.msl
index b05e093..2600a44 100644
--- a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_1e9d53() {
-  float2 res = fabs(float2(1.0f));
+  float2 res = float2(1.0f);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.spvasm
index 237652f..5df0eaa 100644
--- a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/1e9d53.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
  %abs_1e9d53 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %20
-         %13 = OpExtInst %v2float %15 FAbs %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 %abs_1e9d53
+%vertex_main_inner = OpFunction %v4float None %19
+         %21 = OpLabel
+         %22 = OpFunctionCall %void %abs_1e9d53
                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 %abs_1e9d53
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_1e9d53
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_1e9d53
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_1e9d53
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/2f861b.wgsl b/test/tint/builtins/gen/literal/abs/2f861b.wgsl
new file mode 100644
index 0000000..9a01ee4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/2f861b.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 abs(vec<3, fa>) -> vec<3, fa>
+fn abs_2f861b() {
+  var res = abs(vec3(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_2f861b();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_2f861b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_2f861b();
+}
diff --git a/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6315af3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_2f861b() {
+  int3 res = (1).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_2f861b();
+  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() {
+  abs_2f861b();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_2f861b();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6315af3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_2f861b() {
+  int3 res = (1).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_2f861b();
+  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() {
+  abs_2f861b();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_2f861b();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.glsl
new file mode 100644
index 0000000..b669674
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_2f861b() {
+  ivec3 res = ivec3(1);
+}
+
+vec4 vertex_main() {
+  abs_2f861b();
+  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 abs_2f861b() {
+  ivec3 res = ivec3(1);
+}
+
+void fragment_main() {
+  abs_2f861b();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_2f861b() {
+  ivec3 res = ivec3(1);
+}
+
+void compute_main() {
+  abs_2f861b();
+}
+
+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/abs/2f861b.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.msl
new file mode 100644
index 0000000..d985285
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_2f861b() {
+  int3 res = int3(1);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_2f861b();
+  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() {
+  abs_2f861b();
+  return;
+}
+
+kernel void compute_main() {
+  abs_2f861b();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.spvasm
new file mode 100644
index 0000000..b10efe2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 34
+; 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 %abs_2f861b "abs_2f861b"
+               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
+        %int = OpTypeInt 32 1
+      %v3int = OpTypeVector %int 3
+      %int_1 = OpConstant %int 1
+         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+         %19 = OpConstantNull %v3int
+         %20 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+ %abs_2f861b = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %19
+               OpStore %res %16
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %abs_2f861b
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %25 = OpLabel
+         %26 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %26
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_2f861b
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_2f861b
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.wgsl
new file mode 100644
index 0000000..5d6095f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/2f861b.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn abs_2f861b() {
+  var res = abs(vec3(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_2f861b();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_2f861b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_2f861b();
+}
diff --git a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.dxc.hlsl
index 21a367b..602de2a 100644
--- a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_421ca3() {
-  vector<float16_t, 3> res = abs((float16_t(0.0h)).xxx);
+  vector<float16_t, 3> res = (float16_t(0.0h)).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.glsl
index 7a0603d..b924dc4 100644
--- a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void abs_421ca3() {
-  f16vec3 res = abs(f16vec3(0.0hf));
+  f16vec3 res = f16vec3(0.0hf);
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void abs_421ca3() {
-  f16vec3 res = abs(f16vec3(0.0hf));
+  f16vec3 res = f16vec3(0.0hf);
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void abs_421ca3() {
-  f16vec3 res = abs(f16vec3(0.0hf));
+  f16vec3 res = f16vec3(0.0hf);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.msl
index 24f22ad..77b5544 100644
--- a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_421ca3() {
-  half3 res = fabs(half3(0.0h));
+  half3 res = half3(0.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.spvasm
index 4dc29a2..1761fe3 100644
--- a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 32
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                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,36 +36,35 @@
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
-         %17 = OpConstantNull %v3half
+         %15 = OpConstantNull %v3half
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %20 = OpTypeFunction %v4float
+         %18 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
  %abs_421ca3 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %17
-         %13 = OpExtInst %v3half %16 FAbs %17
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_v3half Function %15
+               OpStore %res %15
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_421ca3
+%vertex_main_inner = OpFunction %v4float None %18
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %abs_421ca3
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+         %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
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_421ca3
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_421ca3
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_421ca3
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_421ca3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.dxc.hlsl
index b2deec6..67452cd 100644
--- a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_467cd1() {
-  uint res = abs(1u);
+  uint res = 1u;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.fxc.hlsl
index b2deec6..67452cd 100644
--- a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void abs_467cd1() {
-  uint res = abs(1u);
+  uint res = 1u;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.msl
index 22849cd..c3b3c34 100644
--- a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_467cd1() {
-  uint res = abs(1u);
+  uint res = 1u;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.spvasm
index b5c27c3..dc7ff3a 100644
--- a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 32
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -33,34 +33,34 @@
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
-         %19 = OpTypeFunction %v4float
+         %17 = OpConstantNull %uint
+         %18 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
  %abs_467cd1 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %18
+        %res = OpVariable %_ptr_Function_uint Function %17
                OpStore %res %uint_1
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %abs_467cd1
+%vertex_main_inner = OpFunction %v4float None %18
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %abs_467cd1
                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 %abs_467cd1
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_467cd1
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %abs_467cd1
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_467cd1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.dxc.hlsl
index 44825b3..59d9ee0 100644
--- a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_4ad288() {
-  int res = abs(1);
+  int res = 1;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.fxc.hlsl
index 44825b3..59d9ee0 100644
--- a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void abs_4ad288() {
-  int res = abs(1);
+  int res = 1;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.glsl
index 57f766d..25c9285 100644
--- a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void abs_4ad288() {
-  int res = abs(1);
+  int res = 1;
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void abs_4ad288() {
-  int res = abs(1);
+  int res = 1;
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void abs_4ad288() {
-  int res = abs(1);
+  int res = 1;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.msl
index 60fb737..7b013b1 100644
--- a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_4ad288() {
-  int res = abs(1);
+  int res = 1;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.spvasm
index 1512a8c..ce5fb9a 100644
--- a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/4ad288.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"
@@ -34,35 +33,34 @@
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %19 = OpConstantNull %int
-         %20 = OpTypeFunction %v4float
+         %17 = OpConstantNull %int
+         %18 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
  %abs_4ad288 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %19
-         %13 = OpExtInst %int %15 SAbs %int_1
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_int Function %17
+               OpStore %res %int_1
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_4ad288
+%vertex_main_inner = OpFunction %v4float None %18
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %abs_4ad288
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+         %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
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_4ad288
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_4ad288
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_4ad288
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_4ad288
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.dxc.hlsl
index 1ce3e01..c42ede9 100644
--- a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_538d29() {
-  vector<float16_t, 4> res = abs((float16_t(0.0h)).xxxx);
+  vector<float16_t, 4> res = (float16_t(0.0h)).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.glsl
index 64b283b..cf355d6 100644
--- a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void abs_538d29() {
-  f16vec4 res = abs(f16vec4(0.0hf));
+  f16vec4 res = f16vec4(0.0hf);
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void abs_538d29() {
-  f16vec4 res = abs(f16vec4(0.0hf));
+  f16vec4 res = f16vec4(0.0hf);
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void abs_538d29() {
-  f16vec4 res = abs(f16vec4(0.0hf));
+  f16vec4 res = f16vec4(0.0hf);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.msl
index 867e989..c8c9f6a 100644
--- a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_538d29() {
-  half4 res = fabs(half4(0.0h));
+  half4 res = half4(0.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.spvasm
index d3446768..707e86f 100644
--- a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 32
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                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,36 +36,35 @@
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
-         %17 = OpConstantNull %v4half
+         %15 = OpConstantNull %v4half
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %20 = OpTypeFunction %v4float
+         %18 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
  %abs_538d29 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %17
-         %13 = OpExtInst %v4half %16 FAbs %17
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_v4half Function %15
+               OpStore %res %15
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_538d29
+%vertex_main_inner = OpFunction %v4float None %18
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %abs_538d29
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+         %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
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_538d29
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_538d29
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_538d29
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_538d29
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/577d6e.wgsl b/test/tint/builtins/gen/literal/abs/577d6e.wgsl
new file mode 100644
index 0000000..0a1d61f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/577d6e.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 abs(vec<2, ia>) -> vec<2, ia>
+fn abs_577d6e() {
+  var res = abs(vec2(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_577d6e();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_577d6e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_577d6e();
+}
diff --git a/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b4f3ce7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_577d6e() {
+  float2 res = (1.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_577d6e();
+  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() {
+  abs_577d6e();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_577d6e();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b4f3ce7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_577d6e() {
+  float2 res = (1.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_577d6e();
+  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() {
+  abs_577d6e();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_577d6e();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.glsl
new file mode 100644
index 0000000..096262c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_577d6e() {
+  vec2 res = vec2(1.0f);
+}
+
+vec4 vertex_main() {
+  abs_577d6e();
+  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 abs_577d6e() {
+  vec2 res = vec2(1.0f);
+}
+
+void fragment_main() {
+  abs_577d6e();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_577d6e() {
+  vec2 res = vec2(1.0f);
+}
+
+void compute_main() {
+  abs_577d6e();
+}
+
+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/abs/577d6e.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.msl
new file mode 100644
index 0000000..4e92bd1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_577d6e() {
+  float2 res = float2(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_577d6e();
+  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() {
+  abs_577d6e();
+  return;
+}
+
+kernel void compute_main() {
+  abs_577d6e();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.spvasm
new file mode 100644
index 0000000..648166a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/577d6e.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 %abs_577d6e "abs_577d6e"
+               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
+ %abs_577d6e = 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 %abs_577d6e
+               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 %abs_577d6e
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_577d6e
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.wgsl
new file mode 100644
index 0000000..776e79a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/577d6e.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn abs_577d6e() {
+  var res = abs(vec2(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_577d6e();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_577d6e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_577d6e();
+}
diff --git a/test/tint/builtins/gen/literal/abs/5a8af1.wgsl b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl
new file mode 100644
index 0000000..8410ba1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/5a8af1.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 abs(ia) -> ia
+fn abs_5a8af1() {
+  var res = abs(1.0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_5a8af1();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_5a8af1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_5a8af1();
+}
diff --git a/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d571cd6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_5a8af1() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_5a8af1();
+  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() {
+  abs_5a8af1();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_5a8af1();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d571cd6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_5a8af1() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_5a8af1();
+  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() {
+  abs_5a8af1();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_5a8af1();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.glsl
new file mode 100644
index 0000000..98ca290
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_5a8af1() {
+  float res = 1.0f;
+}
+
+vec4 vertex_main() {
+  abs_5a8af1();
+  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 abs_5a8af1() {
+  float res = 1.0f;
+}
+
+void fragment_main() {
+  abs_5a8af1();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_5a8af1() {
+  float res = 1.0f;
+}
+
+void compute_main() {
+  abs_5a8af1();
+}
+
+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/abs/5a8af1.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.msl
new file mode 100644
index 0000000..6ef8f36
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_5a8af1() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_5a8af1();
+  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() {
+  abs_5a8af1();
+  return;
+}
+
+kernel void compute_main() {
+  abs_5a8af1();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.spvasm
new file mode 100644
index 0000000..5027752
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/5a8af1.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 %abs_5a8af1 "abs_5a8af1"
+               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
+ %abs_5a8af1 = 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 %abs_5a8af1
+               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 %abs_5a8af1
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_5a8af1
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.wgsl
new file mode 100644
index 0000000..2af33ab
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn abs_5a8af1() {
+  var res = abs(1.0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_5a8af1();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_5a8af1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_5a8af1();
+}
diff --git a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.dxc.hlsl
index 1741eca..11cc403 100644
--- a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_5ad50a() {
-  int3 res = abs((1).xxx);
+  int3 res = (1).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.fxc.hlsl
index 1741eca..11cc403 100644
--- a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void abs_5ad50a() {
-  int3 res = abs((1).xxx);
+  int3 res = (1).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.glsl
index d0e6e5f..d3f01d4 100644
--- a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void abs_5ad50a() {
-  ivec3 res = abs(ivec3(1));
+  ivec3 res = ivec3(1);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void abs_5ad50a() {
-  ivec3 res = abs(ivec3(1));
+  ivec3 res = ivec3(1);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void abs_5ad50a() {
-  ivec3 res = abs(ivec3(1));
+  ivec3 res = ivec3(1);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.msl
index d9c31fc..413ad4e 100644
--- a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_5ad50a() {
-  int3 res = abs(int3(1));
+  int3 res = int3(1);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.spvasm
index e9d0147..b0d2d92 100644
--- a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
-         %16 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -34,37 +33,36 @@
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %18 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %21 = OpConstantNull %v3int
-         %22 = OpTypeFunction %v4float
+         %19 = OpConstantNull %v3int
+         %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
  %abs_5ad50a = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %21
-         %13 = OpExtInst %v3int %16 SAbs %18
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_v3int Function %19
+               OpStore %res %16
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %abs_5ad50a
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %abs_5ad50a
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+         %25 = OpLabel
+         %26 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %26
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %abs_5ad50a
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_5ad50a
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %abs_5ad50a
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_5ad50a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.dxc.hlsl
index 8ecbd1d..70b7ca6 100644
--- a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_5ae4fe() {
-  vector<float16_t, 2> res = abs((float16_t(0.0h)).xx);
+  vector<float16_t, 2> res = (float16_t(0.0h)).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.glsl
index e38ffb0..1e08808 100644
--- a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void abs_5ae4fe() {
-  f16vec2 res = abs(f16vec2(0.0hf));
+  f16vec2 res = f16vec2(0.0hf);
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void abs_5ae4fe() {
-  f16vec2 res = abs(f16vec2(0.0hf));
+  f16vec2 res = f16vec2(0.0hf);
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void abs_5ae4fe() {
-  f16vec2 res = abs(f16vec2(0.0hf));
+  f16vec2 res = f16vec2(0.0hf);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.msl
index 3048925..8b1b5bf 100644
--- a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_5ae4fe() {
-  half2 res = fabs(half2(0.0h));
+  half2 res = half2(0.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.spvasm
index 0827248..abebb5f 100644
--- a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 32
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                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,36 +36,35 @@
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
-         %17 = OpConstantNull %v2half
+         %15 = OpConstantNull %v2half
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %20 = OpTypeFunction %v4float
+         %18 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
  %abs_5ae4fe = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %17
-         %13 = OpExtInst %v2half %16 FAbs %17
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_v2half Function %15
+               OpStore %res %15
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_5ae4fe
+%vertex_main_inner = OpFunction %v4float None %18
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %abs_5ae4fe
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+         %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
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_5ae4fe
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_5ae4fe
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_5ae4fe
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_5ae4fe
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.dxc.hlsl
index 9eeb70b..88e5fc4 100644
--- a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_7326de() {
-  uint3 res = abs((1u).xxx);
+  uint3 res = (1u).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.fxc.hlsl
index 9eeb70b..88e5fc4 100644
--- a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void abs_7326de() {
-  uint3 res = abs((1u).xxx);
+  uint3 res = (1u).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.msl
index 4d75de9..3f4309c 100644
--- a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_7326de() {
-  uint3 res = abs(uint3(1u));
+  uint3 res = uint3(1u);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.spvasm
index 455a896..09f9139 100644
--- a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -33,36 +33,36 @@
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %17 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %20 = OpConstantNull %v3uint
-         %21 = OpTypeFunction %v4float
+         %19 = OpConstantNull %v3uint
+         %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
  %abs_7326de = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %20
-               OpStore %res %17
+        %res = OpVariable %_ptr_Function_v3uint Function %19
+               OpStore %res %16
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %abs_7326de
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %abs_7326de
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+         %25 = OpLabel
+         %26 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %26
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %abs_7326de
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_7326de
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %abs_7326de
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_7326de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.dxc.hlsl
index ede7f1e..72e7014 100644
--- a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_7f28e6() {
-  uint2 res = abs((1u).xx);
+  uint2 res = (1u).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.fxc.hlsl
index ede7f1e..72e7014 100644
--- a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void abs_7f28e6() {
-  uint2 res = abs((1u).xx);
+  uint2 res = (1u).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.msl
index 9e46018..835fcb5 100644
--- a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_7f28e6() {
-  uint2 res = abs(uint2(1u));
+  uint2 res = uint2(1u);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.spvasm
index 659eeb5..ddd3fa0 100644
--- a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -33,36 +33,36 @@
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %17 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %20 = OpConstantNull %v2uint
-         %21 = OpTypeFunction %v4float
+         %19 = OpConstantNull %v2uint
+         %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
  %abs_7f28e6 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %20
-               OpStore %res %17
+        %res = OpVariable %_ptr_Function_v2uint Function %19
+               OpStore %res %16
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %abs_7f28e6
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %abs_7f28e6
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+         %25 = OpLabel
+         %26 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %26
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %abs_7f28e6
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_7f28e6
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %abs_7f28e6
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_7f28e6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.dxc.hlsl
index 86d8642..0cd314a 100644
--- a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_7faa9e() {
-  int2 res = abs((1).xx);
+  int2 res = (1).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.fxc.hlsl
index 86d8642..0cd314a 100644
--- a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void abs_7faa9e() {
-  int2 res = abs((1).xx);
+  int2 res = (1).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.glsl
index 600cc78..73aacee 100644
--- a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void abs_7faa9e() {
-  ivec2 res = abs(ivec2(1));
+  ivec2 res = ivec2(1);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void abs_7faa9e() {
-  ivec2 res = abs(ivec2(1));
+  ivec2 res = ivec2(1);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void abs_7faa9e() {
-  ivec2 res = abs(ivec2(1));
+  ivec2 res = ivec2(1);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.msl
index c46f48d..a14e992 100644
--- a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_7faa9e() {
-  int2 res = abs(int2(1));
+  int2 res = int2(1);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.spvasm
index 1fbfa3a..0fd80ff 100644
--- a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
-         %16 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -34,37 +33,36 @@
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %18 = OpConstantComposite %v2int %int_1 %int_1
+         %16 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %21 = OpConstantNull %v2int
-         %22 = OpTypeFunction %v4float
+         %19 = OpConstantNull %v2int
+         %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
  %abs_7faa9e = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %21
-         %13 = OpExtInst %v2int %16 SAbs %18
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_v2int Function %19
+               OpStore %res %16
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %abs_7faa9e
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %abs_7faa9e
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+         %25 = OpLabel
+         %26 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %26
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %abs_7faa9e
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_7faa9e
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %abs_7faa9e
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_7faa9e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/82ff9d.wgsl b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl
new file mode 100644
index 0000000..fe0ea5d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/82ff9d.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 abs(vec<2, fa>) -> vec<2, fa>
+fn abs_82ff9d() {
+  var res = abs(vec2(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_82ff9d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_82ff9d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_82ff9d();
+}
diff --git a/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..60243f7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_82ff9d() {
+  int2 res = (1).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_82ff9d();
+  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() {
+  abs_82ff9d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_82ff9d();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..60243f7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_82ff9d() {
+  int2 res = (1).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_82ff9d();
+  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() {
+  abs_82ff9d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_82ff9d();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.glsl
new file mode 100644
index 0000000..f1cc268
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_82ff9d() {
+  ivec2 res = ivec2(1);
+}
+
+vec4 vertex_main() {
+  abs_82ff9d();
+  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 abs_82ff9d() {
+  ivec2 res = ivec2(1);
+}
+
+void fragment_main() {
+  abs_82ff9d();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_82ff9d() {
+  ivec2 res = ivec2(1);
+}
+
+void compute_main() {
+  abs_82ff9d();
+}
+
+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/abs/82ff9d.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.msl
new file mode 100644
index 0000000..43cd910
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_82ff9d() {
+  int2 res = int2(1);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_82ff9d();
+  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() {
+  abs_82ff9d();
+  return;
+}
+
+kernel void compute_main() {
+  abs_82ff9d();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.spvasm
new file mode 100644
index 0000000..ad5dc10
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 34
+; 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 %abs_82ff9d "abs_82ff9d"
+               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
+        %int = OpTypeInt 32 1
+      %v2int = OpTypeVector %int 2
+      %int_1 = OpConstant %int 1
+         %16 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+         %19 = OpConstantNull %v2int
+         %20 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+ %abs_82ff9d = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %19
+               OpStore %res %16
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %abs_82ff9d
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %25 = OpLabel
+         %26 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %26
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_82ff9d
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_82ff9d
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.wgsl
new file mode 100644
index 0000000..9bd3f7c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn abs_82ff9d() {
+  var res = abs(vec2(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_82ff9d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_82ff9d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_82ff9d();
+}
diff --git a/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl
new file mode 100644
index 0000000..f99c3c8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/8ca9b1.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 abs(vec<4, ia>) -> vec<4, ia>
+fn abs_8ca9b1() {
+  var res = abs(vec4(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_8ca9b1();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_8ca9b1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_8ca9b1();
+}
diff --git a/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..254e652
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_8ca9b1() {
+  float4 res = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_8ca9b1();
+  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() {
+  abs_8ca9b1();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_8ca9b1();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..254e652
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_8ca9b1() {
+  float4 res = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_8ca9b1();
+  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() {
+  abs_8ca9b1();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_8ca9b1();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.glsl
new file mode 100644
index 0000000..3e153f7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_8ca9b1() {
+  vec4 res = vec4(1.0f);
+}
+
+vec4 vertex_main() {
+  abs_8ca9b1();
+  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 abs_8ca9b1() {
+  vec4 res = vec4(1.0f);
+}
+
+void fragment_main() {
+  abs_8ca9b1();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_8ca9b1() {
+  vec4 res = vec4(1.0f);
+}
+
+void compute_main() {
+  abs_8ca9b1();
+}
+
+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/abs/8ca9b1.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.msl
new file mode 100644
index 0000000..8dd66e4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_8ca9b1() {
+  float4 res = float4(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_8ca9b1();
+  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() {
+  abs_8ca9b1();
+  return;
+}
+
+kernel void compute_main() {
+  abs_8ca9b1();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.spvasm
new file mode 100644
index 0000000..967646f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/8ca9b1.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 %abs_8ca9b1 "abs_8ca9b1"
+               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
+ %abs_8ca9b1 = 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 %abs_8ca9b1
+               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 %abs_8ca9b1
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %abs_8ca9b1
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.wgsl
new file mode 100644
index 0000000..6817228
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn abs_8ca9b1() {
+  var res = abs(vec4(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_8ca9b1();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_8ca9b1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_8ca9b1();
+}
diff --git a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.dxc.hlsl
index bce474d..8a74a1a 100644
--- a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_9c80a6() {
-  int4 res = abs((1).xxxx);
+  int4 res = (1).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.fxc.hlsl
index bce474d..8a74a1a 100644
--- a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void abs_9c80a6() {
-  int4 res = abs((1).xxxx);
+  int4 res = (1).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.glsl
index aefe8c8..3f50690 100644
--- a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void abs_9c80a6() {
-  ivec4 res = abs(ivec4(1));
+  ivec4 res = ivec4(1);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void abs_9c80a6() {
-  ivec4 res = abs(ivec4(1));
+  ivec4 res = ivec4(1);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void abs_9c80a6() {
-  ivec4 res = abs(ivec4(1));
+  ivec4 res = ivec4(1);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.msl
index 833671a..6952fcb 100644
--- a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_9c80a6() {
-  int4 res = abs(int4(1));
+  int4 res = int4(1);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.spvasm
index 50b4cec..dd112f8 100644
--- a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
-         %16 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -34,37 +33,36 @@
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
       %int_1 = OpConstant %int 1
-         %18 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %21 = OpConstantNull %v4int
-         %22 = OpTypeFunction %v4float
+         %19 = OpConstantNull %v4int
+         %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
  %abs_9c80a6 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %21
-         %13 = OpExtInst %v4int %16 SAbs %18
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_v4int Function %19
+               OpStore %res %16
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %abs_9c80a6
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %abs_9c80a6
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+         %25 = OpLabel
+         %26 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %26
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %abs_9c80a6
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_9c80a6
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %abs_9c80a6
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_9c80a6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/aedb6d.wgsl b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl
new file mode 100644
index 0000000..b9167db
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/aedb6d.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 abs(fa) -> fa
+fn abs_aedb6d() {
+  var res = abs(1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_aedb6d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_aedb6d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_aedb6d();
+}
diff --git a/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c6333ed
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_aedb6d() {
+  int res = 1;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_aedb6d();
+  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() {
+  abs_aedb6d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_aedb6d();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c6333ed
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_aedb6d() {
+  int res = 1;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_aedb6d();
+  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() {
+  abs_aedb6d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_aedb6d();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.glsl
new file mode 100644
index 0000000..8f21da4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_aedb6d() {
+  int res = 1;
+}
+
+vec4 vertex_main() {
+  abs_aedb6d();
+  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 abs_aedb6d() {
+  int res = 1;
+}
+
+void fragment_main() {
+  abs_aedb6d();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_aedb6d() {
+  int res = 1;
+}
+
+void compute_main() {
+  abs_aedb6d();
+}
+
+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/abs/aedb6d.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.msl
new file mode 100644
index 0000000..e27ed9f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_aedb6d() {
+  int res = 1;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_aedb6d();
+  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() {
+  abs_aedb6d();
+  return;
+}
+
+kernel void compute_main() {
+  abs_aedb6d();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.spvasm
new file mode 100644
index 0000000..f52b339
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/aedb6d.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 %abs_aedb6d "abs_aedb6d"
+               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
+        %int = OpTypeInt 32 1
+      %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+         %17 = OpConstantNull %int
+         %18 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+ %abs_aedb6d = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %17
+               OpStore %res %int_1
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %18
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %abs_aedb6d
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %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
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_aedb6d
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_aedb6d
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.wgsl
new file mode 100644
index 0000000..21a2cd9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn abs_aedb6d() {
+  var res = abs(1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_aedb6d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_aedb6d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_aedb6d();
+}
diff --git a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.dxc.hlsl
index a4c7c03..51fa706 100644
--- a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_b96037() {
-  float res = abs(1.0f);
+  float res = 1.0f;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.fxc.hlsl
index a4c7c03..51fa706 100644
--- a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void abs_b96037() {
-  float res = abs(1.0f);
+  float res = 1.0f;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.glsl
index 53edae5..c26be0b 100644
--- a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void abs_b96037() {
-  float res = abs(1.0f);
+  float res = 1.0f;
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void abs_b96037() {
-  float res = abs(1.0f);
+  float res = 1.0f;
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void abs_b96037() {
-  float res = abs(1.0f);
+  float res = 1.0f;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.msl
index 38e2f9b..00d7df9 100644
--- a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_b96037() {
-  float res = fabs(1.0f);
+  float res = 1.0f;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.spvasm
index 8118fd5..3e45fe5 100644
--- a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/b96037.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
  %abs_b96037 = OpFunction %void None %9
          %12 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %13 = OpExtInst %float %14 FAbs %float_1
-               OpStore %res %13
+               OpStore %res %float_1
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %abs_b96037
+%vertex_main_inner = OpFunction %v4float None %16
+         %18 = OpLabel
+         %19 = OpFunctionCall %void %abs_b96037
                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 %abs_b96037
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %abs_b96037
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_b96037
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_b96037
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/c3321c.wgsl b/test/tint/builtins/gen/literal/abs/c3321c.wgsl
new file mode 100644
index 0000000..4276e5b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/c3321c.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 abs(vec<3, ia>) -> vec<3, ia>
+fn abs_c3321c() {
+  var res = abs(vec3(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_c3321c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_c3321c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_c3321c();
+}
diff --git a/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d56d57a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_c3321c() {
+  float3 res = (1.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_c3321c();
+  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() {
+  abs_c3321c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_c3321c();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d56d57a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_c3321c() {
+  float3 res = (1.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_c3321c();
+  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() {
+  abs_c3321c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_c3321c();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.glsl
new file mode 100644
index 0000000..6b1cea3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_c3321c() {
+  vec3 res = vec3(1.0f);
+}
+
+vec4 vertex_main() {
+  abs_c3321c();
+  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 abs_c3321c() {
+  vec3 res = vec3(1.0f);
+}
+
+void fragment_main() {
+  abs_c3321c();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_c3321c() {
+  vec3 res = vec3(1.0f);
+}
+
+void compute_main() {
+  abs_c3321c();
+}
+
+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/abs/c3321c.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.msl
new file mode 100644
index 0000000..eed8424
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_c3321c() {
+  float3 res = float3(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_c3321c();
+  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() {
+  abs_c3321c();
+  return;
+}
+
+kernel void compute_main() {
+  abs_c3321c();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.spvasm
new file mode 100644
index 0000000..92db6e9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/c3321c.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 %abs_c3321c "abs_c3321c"
+               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
+ %abs_c3321c = 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 %abs_c3321c
+               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 %abs_c3321c
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_c3321c
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.wgsl
new file mode 100644
index 0000000..db49261
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/c3321c.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn abs_c3321c() {
+  var res = abs(vec3(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_c3321c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_c3321c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_c3321c();
+}
diff --git a/test/tint/builtins/gen/literal/abs/e28785.wgsl b/test/tint/builtins/gen/literal/abs/e28785.wgsl
new file mode 100644
index 0000000..714f3e1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/e28785.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 abs(vec<4, fa>) -> vec<4, fa>
+fn abs_e28785() {
+  var res = abs(vec4(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_e28785();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_e28785();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_e28785();
+}
diff --git a/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0c83f68
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_e28785() {
+  int4 res = (1).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_e28785();
+  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() {
+  abs_e28785();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_e28785();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0c83f68
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_e28785() {
+  int4 res = (1).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_e28785();
+  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() {
+  abs_e28785();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_e28785();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.glsl
new file mode 100644
index 0000000..ef86df6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_e28785() {
+  ivec4 res = ivec4(1);
+}
+
+vec4 vertex_main() {
+  abs_e28785();
+  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 abs_e28785() {
+  ivec4 res = ivec4(1);
+}
+
+void fragment_main() {
+  abs_e28785();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_e28785() {
+  ivec4 res = ivec4(1);
+}
+
+void compute_main() {
+  abs_e28785();
+}
+
+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/abs/e28785.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.msl
new file mode 100644
index 0000000..f88e571
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_e28785() {
+  int4 res = int4(1);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_e28785();
+  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() {
+  abs_e28785();
+  return;
+}
+
+kernel void compute_main() {
+  abs_e28785();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.spvasm
new file mode 100644
index 0000000..fb64961
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 34
+; 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 %abs_e28785 "abs_e28785"
+               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
+        %int = OpTypeInt 32 1
+      %v4int = OpTypeVector %int 4
+      %int_1 = OpConstant %int 1
+         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+         %19 = OpConstantNull %v4int
+         %20 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+ %abs_e28785 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %19
+               OpStore %res %16
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %abs_e28785
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %25 = OpLabel
+         %26 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %26
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_e28785
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_e28785
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.wgsl
new file mode 100644
index 0000000..3bc8faa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/abs/e28785.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn abs_e28785() {
+  var res = abs(vec4(1));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_e28785();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_e28785();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_e28785();
+}
diff --git a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.dxc.hlsl
index 6f68c08..e9cf905 100644
--- a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void abs_fd247f() {
-  float16_t res = abs(float16_t(0.0h));
+  float16_t res = float16_t(0.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.glsl
index 2c864eb..451b053 100644
--- a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void abs_fd247f() {
-  float16_t res = abs(0.0hf);
+  float16_t res = 0.0hf;
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void abs_fd247f() {
-  float16_t res = abs(0.0hf);
+  float16_t res = 0.0hf;
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void abs_fd247f() {
-  float16_t res = abs(0.0hf);
+  float16_t res = 0.0hf;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.msl
index 6c6c738..524a545 100644
--- a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void abs_fd247f() {
-  half res = fabs(0.0h);
+  half res = 0.0h;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.spvasm
index 3472743..eb3438d 100644
--- a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 31
 ; 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,35 @@
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %16 = OpConstantNull %half
+         %14 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %19 = OpTypeFunction %v4float
+         %17 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
  %abs_fd247f = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %16
-         %13 = OpExtInst %half %15 FAbs %16
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_half Function %14
+               OpStore %res %14
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %abs_fd247f
+%vertex_main_inner = OpFunction %v4float None %17
+         %19 = OpLabel
+         %20 = OpFunctionCall %void %abs_fd247f
                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
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %abs_fd247f
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %abs_fd247f
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %abs_fd247f
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_fd247f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/2f861b.wgsl b/test/tint/builtins/gen/var/abs/2f861b.wgsl
new file mode 100644
index 0000000..53d4077
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/2f861b.wgsl
@@ -0,0 +1,44 @@
+// 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 abs(vec<3, fa>) -> vec<3, fa>
+fn abs_2f861b() {
+  const arg_0 = vec3(1);
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_2f861b();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_2f861b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_2f861b();
+}
diff --git a/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6315af3
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_2f861b() {
+  int3 res = (1).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_2f861b();
+  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() {
+  abs_2f861b();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_2f861b();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6315af3
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_2f861b() {
+  int3 res = (1).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_2f861b();
+  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() {
+  abs_2f861b();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_2f861b();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.glsl
new file mode 100644
index 0000000..b669674
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_2f861b() {
+  ivec3 res = ivec3(1);
+}
+
+vec4 vertex_main() {
+  abs_2f861b();
+  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 abs_2f861b() {
+  ivec3 res = ivec3(1);
+}
+
+void fragment_main() {
+  abs_2f861b();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_2f861b() {
+  ivec3 res = ivec3(1);
+}
+
+void compute_main() {
+  abs_2f861b();
+}
+
+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/abs/2f861b.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.msl
new file mode 100644
index 0000000..d985285
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_2f861b() {
+  int3 res = int3(1);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_2f861b();
+  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() {
+  abs_2f861b();
+  return;
+}
+
+kernel void compute_main() {
+  abs_2f861b();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.spvasm
new file mode 100644
index 0000000..b10efe2
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 34
+; 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 %abs_2f861b "abs_2f861b"
+               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
+        %int = OpTypeInt 32 1
+      %v3int = OpTypeVector %int 3
+      %int_1 = OpConstant %int 1
+         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+         %19 = OpConstantNull %v3int
+         %20 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+ %abs_2f861b = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %19
+               OpStore %res %16
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %abs_2f861b
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %25 = OpLabel
+         %26 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %26
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_2f861b
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_2f861b
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.wgsl
new file mode 100644
index 0000000..b4e57c3
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/2f861b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn abs_2f861b() {
+  const arg_0 = vec3(1);
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_2f861b();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_2f861b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_2f861b();
+}
diff --git a/test/tint/builtins/gen/var/abs/577d6e.wgsl b/test/tint/builtins/gen/var/abs/577d6e.wgsl
new file mode 100644
index 0000000..1a897e6
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/577d6e.wgsl
@@ -0,0 +1,44 @@
+// 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 abs(vec<2, ia>) -> vec<2, ia>
+fn abs_577d6e() {
+  const arg_0 = vec2(1.0);
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_577d6e();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_577d6e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_577d6e();
+}
diff --git a/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b4f3ce7
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_577d6e() {
+  float2 res = (1.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_577d6e();
+  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() {
+  abs_577d6e();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_577d6e();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b4f3ce7
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_577d6e() {
+  float2 res = (1.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_577d6e();
+  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() {
+  abs_577d6e();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_577d6e();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.glsl
new file mode 100644
index 0000000..096262c
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_577d6e() {
+  vec2 res = vec2(1.0f);
+}
+
+vec4 vertex_main() {
+  abs_577d6e();
+  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 abs_577d6e() {
+  vec2 res = vec2(1.0f);
+}
+
+void fragment_main() {
+  abs_577d6e();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_577d6e() {
+  vec2 res = vec2(1.0f);
+}
+
+void compute_main() {
+  abs_577d6e();
+}
+
+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/abs/577d6e.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.msl
new file mode 100644
index 0000000..4e92bd1
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_577d6e() {
+  float2 res = float2(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_577d6e();
+  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() {
+  abs_577d6e();
+  return;
+}
+
+kernel void compute_main() {
+  abs_577d6e();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.spvasm
new file mode 100644
index 0000000..648166a
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/577d6e.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 %abs_577d6e "abs_577d6e"
+               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
+ %abs_577d6e = 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 %abs_577d6e
+               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 %abs_577d6e
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_577d6e
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.wgsl
new file mode 100644
index 0000000..9ba7c2e
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/577d6e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn abs_577d6e() {
+  const arg_0 = vec2(1.0);
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_577d6e();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_577d6e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_577d6e();
+}
diff --git a/test/tint/builtins/gen/var/abs/5a8af1.wgsl b/test/tint/builtins/gen/var/abs/5a8af1.wgsl
new file mode 100644
index 0000000..35d7360
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/5a8af1.wgsl
@@ -0,0 +1,44 @@
+// 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 abs(ia) -> ia
+fn abs_5a8af1() {
+  const arg_0 = 1.0;
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_5a8af1();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_5a8af1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_5a8af1();
+}
diff --git a/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d571cd6
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_5a8af1() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_5a8af1();
+  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() {
+  abs_5a8af1();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_5a8af1();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d571cd6
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_5a8af1() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_5a8af1();
+  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() {
+  abs_5a8af1();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_5a8af1();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.glsl
new file mode 100644
index 0000000..98ca290
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_5a8af1() {
+  float res = 1.0f;
+}
+
+vec4 vertex_main() {
+  abs_5a8af1();
+  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 abs_5a8af1() {
+  float res = 1.0f;
+}
+
+void fragment_main() {
+  abs_5a8af1();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_5a8af1() {
+  float res = 1.0f;
+}
+
+void compute_main() {
+  abs_5a8af1();
+}
+
+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/abs/5a8af1.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.msl
new file mode 100644
index 0000000..6ef8f36
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_5a8af1() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_5a8af1();
+  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() {
+  abs_5a8af1();
+  return;
+}
+
+kernel void compute_main() {
+  abs_5a8af1();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.spvasm
new file mode 100644
index 0000000..5027752
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/5a8af1.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 %abs_5a8af1 "abs_5a8af1"
+               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
+ %abs_5a8af1 = 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 %abs_5a8af1
+               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 %abs_5a8af1
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_5a8af1
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.wgsl
new file mode 100644
index 0000000..f5a71c3
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/5a8af1.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn abs_5a8af1() {
+  const arg_0 = 1.0;
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_5a8af1();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_5a8af1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_5a8af1();
+}
diff --git a/test/tint/builtins/gen/var/abs/82ff9d.wgsl b/test/tint/builtins/gen/var/abs/82ff9d.wgsl
new file mode 100644
index 0000000..1a12b86
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/82ff9d.wgsl
@@ -0,0 +1,44 @@
+// 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 abs(vec<2, fa>) -> vec<2, fa>
+fn abs_82ff9d() {
+  const arg_0 = vec2(1);
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_82ff9d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_82ff9d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_82ff9d();
+}
diff --git a/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..60243f7
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_82ff9d() {
+  int2 res = (1).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_82ff9d();
+  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() {
+  abs_82ff9d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_82ff9d();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..60243f7
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_82ff9d() {
+  int2 res = (1).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_82ff9d();
+  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() {
+  abs_82ff9d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_82ff9d();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.glsl
new file mode 100644
index 0000000..f1cc268
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_82ff9d() {
+  ivec2 res = ivec2(1);
+}
+
+vec4 vertex_main() {
+  abs_82ff9d();
+  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 abs_82ff9d() {
+  ivec2 res = ivec2(1);
+}
+
+void fragment_main() {
+  abs_82ff9d();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_82ff9d() {
+  ivec2 res = ivec2(1);
+}
+
+void compute_main() {
+  abs_82ff9d();
+}
+
+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/abs/82ff9d.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.msl
new file mode 100644
index 0000000..43cd910
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_82ff9d() {
+  int2 res = int2(1);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_82ff9d();
+  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() {
+  abs_82ff9d();
+  return;
+}
+
+kernel void compute_main() {
+  abs_82ff9d();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.spvasm
new file mode 100644
index 0000000..ad5dc10
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 34
+; 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 %abs_82ff9d "abs_82ff9d"
+               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
+        %int = OpTypeInt 32 1
+      %v2int = OpTypeVector %int 2
+      %int_1 = OpConstant %int 1
+         %16 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+         %19 = OpConstantNull %v2int
+         %20 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+ %abs_82ff9d = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %19
+               OpStore %res %16
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %abs_82ff9d
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %25 = OpLabel
+         %26 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %26
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_82ff9d
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_82ff9d
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.wgsl
new file mode 100644
index 0000000..9c13cc5
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/82ff9d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn abs_82ff9d() {
+  const arg_0 = vec2(1);
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_82ff9d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_82ff9d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_82ff9d();
+}
diff --git a/test/tint/builtins/gen/var/abs/8ca9b1.wgsl b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl
new file mode 100644
index 0000000..0d61fc3
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl
@@ -0,0 +1,44 @@
+// 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 abs(vec<4, ia>) -> vec<4, ia>
+fn abs_8ca9b1() {
+  const arg_0 = vec4(1.0);
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_8ca9b1();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_8ca9b1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_8ca9b1();
+}
diff --git a/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..254e652
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_8ca9b1() {
+  float4 res = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_8ca9b1();
+  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() {
+  abs_8ca9b1();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_8ca9b1();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..254e652
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_8ca9b1() {
+  float4 res = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_8ca9b1();
+  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() {
+  abs_8ca9b1();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_8ca9b1();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.glsl
new file mode 100644
index 0000000..3e153f7
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_8ca9b1() {
+  vec4 res = vec4(1.0f);
+}
+
+vec4 vertex_main() {
+  abs_8ca9b1();
+  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 abs_8ca9b1() {
+  vec4 res = vec4(1.0f);
+}
+
+void fragment_main() {
+  abs_8ca9b1();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_8ca9b1() {
+  vec4 res = vec4(1.0f);
+}
+
+void compute_main() {
+  abs_8ca9b1();
+}
+
+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/abs/8ca9b1.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.msl
new file mode 100644
index 0000000..8dd66e4
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_8ca9b1() {
+  float4 res = float4(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_8ca9b1();
+  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() {
+  abs_8ca9b1();
+  return;
+}
+
+kernel void compute_main() {
+  abs_8ca9b1();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.spvasm
new file mode 100644
index 0000000..967646f
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/8ca9b1.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 %abs_8ca9b1 "abs_8ca9b1"
+               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
+ %abs_8ca9b1 = 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 %abs_8ca9b1
+               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 %abs_8ca9b1
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %abs_8ca9b1
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.wgsl
new file mode 100644
index 0000000..ef2c0e5
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn abs_8ca9b1() {
+  const arg_0 = vec4(1.0);
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_8ca9b1();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_8ca9b1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_8ca9b1();
+}
diff --git a/test/tint/builtins/gen/var/abs/aedb6d.wgsl b/test/tint/builtins/gen/var/abs/aedb6d.wgsl
new file mode 100644
index 0000000..1d61796
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/aedb6d.wgsl
@@ -0,0 +1,44 @@
+// 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 abs(fa) -> fa
+fn abs_aedb6d() {
+  const arg_0 = 1;
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_aedb6d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_aedb6d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_aedb6d();
+}
diff --git a/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c6333ed
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_aedb6d() {
+  int res = 1;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_aedb6d();
+  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() {
+  abs_aedb6d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_aedb6d();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c6333ed
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_aedb6d() {
+  int res = 1;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_aedb6d();
+  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() {
+  abs_aedb6d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_aedb6d();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.glsl
new file mode 100644
index 0000000..8f21da4
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_aedb6d() {
+  int res = 1;
+}
+
+vec4 vertex_main() {
+  abs_aedb6d();
+  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 abs_aedb6d() {
+  int res = 1;
+}
+
+void fragment_main() {
+  abs_aedb6d();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_aedb6d() {
+  int res = 1;
+}
+
+void compute_main() {
+  abs_aedb6d();
+}
+
+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/abs/aedb6d.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.msl
new file mode 100644
index 0000000..e27ed9f
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_aedb6d() {
+  int res = 1;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_aedb6d();
+  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() {
+  abs_aedb6d();
+  return;
+}
+
+kernel void compute_main() {
+  abs_aedb6d();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.spvasm
new file mode 100644
index 0000000..f52b339
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/aedb6d.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 %abs_aedb6d "abs_aedb6d"
+               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
+        %int = OpTypeInt 32 1
+      %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+         %17 = OpConstantNull %int
+         %18 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+ %abs_aedb6d = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %17
+               OpStore %res %int_1
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %18
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %abs_aedb6d
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %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
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_aedb6d
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_aedb6d
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.wgsl
new file mode 100644
index 0000000..7897c84
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/aedb6d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn abs_aedb6d() {
+  const arg_0 = 1;
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_aedb6d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_aedb6d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_aedb6d();
+}
diff --git a/test/tint/builtins/gen/var/abs/c3321c.wgsl b/test/tint/builtins/gen/var/abs/c3321c.wgsl
new file mode 100644
index 0000000..9f99d2a
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/c3321c.wgsl
@@ -0,0 +1,44 @@
+// 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 abs(vec<3, ia>) -> vec<3, ia>
+fn abs_c3321c() {
+  const arg_0 = vec3(1.0);
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_c3321c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_c3321c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_c3321c();
+}
diff --git a/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d56d57a
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_c3321c() {
+  float3 res = (1.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_c3321c();
+  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() {
+  abs_c3321c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_c3321c();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d56d57a
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_c3321c() {
+  float3 res = (1.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_c3321c();
+  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() {
+  abs_c3321c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_c3321c();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.glsl
new file mode 100644
index 0000000..6b1cea3
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_c3321c() {
+  vec3 res = vec3(1.0f);
+}
+
+vec4 vertex_main() {
+  abs_c3321c();
+  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 abs_c3321c() {
+  vec3 res = vec3(1.0f);
+}
+
+void fragment_main() {
+  abs_c3321c();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_c3321c() {
+  vec3 res = vec3(1.0f);
+}
+
+void compute_main() {
+  abs_c3321c();
+}
+
+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/abs/c3321c.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.msl
new file mode 100644
index 0000000..eed8424
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_c3321c() {
+  float3 res = float3(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_c3321c();
+  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() {
+  abs_c3321c();
+  return;
+}
+
+kernel void compute_main() {
+  abs_c3321c();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.spvasm
new file mode 100644
index 0000000..92db6e9
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/c3321c.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 %abs_c3321c "abs_c3321c"
+               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
+ %abs_c3321c = 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 %abs_c3321c
+               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 %abs_c3321c
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_c3321c
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.wgsl
new file mode 100644
index 0000000..785d26f
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/c3321c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn abs_c3321c() {
+  const arg_0 = vec3(1.0);
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_c3321c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_c3321c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_c3321c();
+}
diff --git a/test/tint/builtins/gen/var/abs/e28785.wgsl b/test/tint/builtins/gen/var/abs/e28785.wgsl
new file mode 100644
index 0000000..a3e43a4
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/e28785.wgsl
@@ -0,0 +1,44 @@
+// 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 abs(vec<4, fa>) -> vec<4, fa>
+fn abs_e28785() {
+  const arg_0 = vec4(1);
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_e28785();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_e28785();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_e28785();
+}
diff --git a/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0c83f68
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void abs_e28785() {
+  int4 res = (1).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_e28785();
+  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() {
+  abs_e28785();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_e28785();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0c83f68
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void abs_e28785() {
+  int4 res = (1).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  abs_e28785();
+  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() {
+  abs_e28785();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  abs_e28785();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.glsl
new file mode 100644
index 0000000..ef86df6
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void abs_e28785() {
+  ivec4 res = ivec4(1);
+}
+
+vec4 vertex_main() {
+  abs_e28785();
+  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 abs_e28785() {
+  ivec4 res = ivec4(1);
+}
+
+void fragment_main() {
+  abs_e28785();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void abs_e28785() {
+  ivec4 res = ivec4(1);
+}
+
+void compute_main() {
+  abs_e28785();
+}
+
+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/abs/e28785.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.msl
new file mode 100644
index 0000000..f88e571
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_e28785() {
+  int4 res = int4(1);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  abs_e28785();
+  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() {
+  abs_e28785();
+  return;
+}
+
+kernel void compute_main() {
+  abs_e28785();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.spvasm
new file mode 100644
index 0000000..fb64961
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 34
+; 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 %abs_e28785 "abs_e28785"
+               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
+        %int = OpTypeInt 32 1
+      %v4int = OpTypeVector %int 4
+      %int_1 = OpConstant %int 1
+         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+         %19 = OpConstantNull %v4int
+         %20 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+ %abs_e28785 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %19
+               OpStore %res %16
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %abs_e28785
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %25 = OpLabel
+         %26 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %26
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_e28785
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_e28785
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.wgsl
new file mode 100644
index 0000000..8c07819
--- /dev/null
+++ b/test/tint/builtins/gen/var/abs/e28785.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn abs_e28785() {
+  const arg_0 = vec4(1);
+  var res = abs(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  abs_e28785();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  abs_e28785();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  abs_e28785();
+}
diff --git a/webgpu-cts/expectations.txt b/webgpu-cts/expectations.txt
index 40adbbe..09f45ce 100644
--- a/webgpu-cts/expectations.txt
+++ b/webgpu-cts/expectations.txt
@@ -391,18 +391,6 @@
 crbug.com/tint/1613 webgpu:shader,execution,expression,binary,f32_arithmetic:remainder:inputSource="const";vectorize=2 [ Failure ]
 crbug.com/tint/1613 webgpu:shader,execution,expression,binary,f32_arithmetic:remainder:inputSource="const";vectorize=3 [ Failure ]
 crbug.com/tint/1613 webgpu:shader,execution,expression,binary,f32_arithmetic:remainder:inputSource="const";vectorize=4 [ Failure ]
-crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,abs:f32:inputSource="const";vectorize="_undef_" [ Failure ]
-crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,abs:f32:inputSource="const";vectorize=2 [ Failure ]
-crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,abs:f32:inputSource="const";vectorize=3 [ Failure ]
-crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,abs:f32:inputSource="const";vectorize=4 [ Failure ]
-crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,abs:i32:inputSource="const";vectorize="_undef_" [ Failure ]
-crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,abs:i32:inputSource="const";vectorize=2 [ Failure ]
-crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,abs:i32:inputSource="const";vectorize=3 [ Failure ]
-crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,abs:i32:inputSource="const";vectorize=4 [ Failure ]
-crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,abs:u32:inputSource="const";vectorize="_undef_" [ Failure ]
-crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,abs:u32:inputSource="const";vectorize=2 [ Failure ]
-crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,abs:u32:inputSource="const";vectorize=3 [ Failure ]
-crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,abs:u32:inputSource="const";vectorize=4 [ Failure ]
 crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,acosh:f32:inputSource="const";vectorize="_undef_" [ Failure ]
 crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,acosh:f32:inputSource="const";vectorize=2 [ Failure ]
 crbug.com/tint/1613 webgpu:shader,execution,expression,call,builtin,acosh:f32:inputSource="const";vectorize=3 [ Failure ]