tint: const eval of transpose builtin

Bug: tint:1581
Change-Id: Ia614647bc4a3d24a53d45981ddcdb1c84ea84608
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111600
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/tint/intrinsics.def b/src/tint/intrinsics.def
index 57eb10d..2a04575 100644
--- a/src/tint/intrinsics.def
+++ b/src/tint/intrinsics.def
@@ -546,7 +546,7 @@
 @const fn tan<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
 @const fn tanh<T: fa_f32_f16>(T) -> T
 @const fn tanh<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
-fn transpose<M: num, N: num, T: f32_f16>(mat<M, N, T>) -> mat<N, M, T>
+@const fn transpose<M: num, N: num, T: fa_f32_f16>(mat<M, N, T>) -> mat<N, M, T>
 @const fn trunc<T: fa_f32_f16>(@test_value(1.5) T) -> T
 @const fn trunc<N: num, T: fa_f32_f16>(@test_value(1.5) vec<N, T>) -> vec<N, T>
 @const fn unpack2x16float(u32) -> vec2<f32>
diff --git a/src/tint/resolver/const_eval.cc b/src/tint/resolver/const_eval.cc
index 2019f59..4e92704 100644
--- a/src/tint/resolver/const_eval.cc
+++ b/src/tint/resolver/const_eval.cc
@@ -3031,6 +3031,26 @@
     return TransformElements(builder, ty, transform, args[0]);
 }
 
+ConstEval::Result ConstEval::transpose(const sem::Type* ty,
+                                       utils::VectorRef<const sem::Constant*> args,
+                                       const Source&) {
+    auto* m = args[0];
+    auto* mat_ty = m->Type()->As<sem::Matrix>();
+    auto me = [&](size_t r, size_t c) { return m->Index(c)->Index(r); };
+    auto* result_mat_ty = ty->As<sem::Matrix>();
+
+    // Produce column vectors from each row
+    utils::Vector<const sem::Constant*, 4> result_mat;
+    for (size_t r = 0; r < mat_ty->rows(); ++r) {
+        utils::Vector<const sem::Constant*, 4> new_col_vec;
+        for (size_t c = 0; c < mat_ty->columns(); ++c) {
+            new_col_vec.Push(me(r, c));
+        }
+        result_mat.Push(CreateComposite(builder, result_mat_ty->ColumnType(), new_col_vec));
+    }
+    return CreateComposite(builder, ty, result_mat);
+}
+
 ConstEval::Result ConstEval::trunc(const sem::Type* ty,
                                    utils::VectorRef<const sem::Constant*> args,
                                    const Source& source) {
diff --git a/src/tint/resolver/const_eval.h b/src/tint/resolver/const_eval.h
index fd253b4..b79270a 100644
--- a/src/tint/resolver/const_eval.h
+++ b/src/tint/resolver/const_eval.h
@@ -863,6 +863,15 @@
                 utils::VectorRef<const sem::Constant*> args,
                 const Source& source);
 
+    /// transpose builtin
+    /// @param ty the expression type
+    /// @param args the input arguments
+    /// @param source the source location
+    /// @return the result value, or null if the value cannot be calculated
+    Result transpose(const sem::Type* ty,
+                     utils::VectorRef<const sem::Constant*> args,
+                     const Source& source);
+
     /// trunc 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 1bf7423..3c2e3c7 100644
--- a/src/tint/resolver/const_eval_builtin_test.cc
+++ b/src/tint/resolver/const_eval_builtin_test.cc
@@ -2093,6 +2093,72 @@
                                               TanhCases<f16>()))));
 
 template <typename T>
+std::vector<Case> TransposeCases() {
+    return {
+        // 2x2
+        C({Mat({T(1), T(2)},    //
+               {T(3), T(4)})},  //
+          Mat({T(1), T(3)},     //
+              {T(2), T(4)})),
+
+        // 3x3
+        C({Mat({T(1), T(2), T(3)},    //
+               {T(4), T(5), T(6)},    //
+               {T(7), T(8), T(9)})},  //
+          Mat({T(1), T(4), T(7)},     //
+              {T(2), T(5), T(8)},     //
+              {T(3), T(6), T(9)})),
+
+        // 4x4
+        C({Mat({T(1), T(2), T(3), T(4)},        //
+               {T(5), T(6), T(7), T(8)},        //
+               {T(9), T(10), T(11), T(12)},     //
+               {T(13), T(14), T(15), T(16)})},  //
+          Mat({T(1), T(5), T(9), T(13)},        //
+              {T(2), T(6), T(10), T(14)},       //
+              {T(3), T(7), T(11), T(15)},       //
+              {T(4), T(8), T(12), T(16)})),
+
+        // 4x2
+        C({Mat({T(1), T(2), T(3), T(4)},    //
+               {T(5), T(6), T(7), T(8)})},  //
+          Mat({T(1), T(5)},                 //
+              {T(2), T(6)},                 //
+              {T(3), T(7)},                 //
+              {T(4), T(8)})),
+
+        // 2x4
+        C({Mat({T(1), T(2)},             //
+               {T(3), T(4)},             //
+               {T(5), T(6)},             //
+               {T(7), T(8)})},           //
+          Mat({T(1), T(3), T(5), T(7)},  //
+              {T(2), T(4), T(6), T(8)})),
+
+        // 3x2
+        C({Mat({T(1), T(2), T(3)},    //
+               {T(4), T(5), T(6)})},  //
+          Mat({T(1), T(4)},           //
+              {T(2), T(5)},           //
+              {T(3), T(6)})),
+
+        // 2x3
+        C({Mat({T(1), T(2)},       //
+               {T(3), T(4)},       //
+               {T(5), T(6)})},     //
+          Mat({T(1), T(3), T(5)},  //
+              {T(2), T(4), T(6)})),
+    };
+}
+INSTANTIATE_TEST_SUITE_P(  //
+    Transpose,
+    ResolverConstEvalBuiltinTest,
+    testing::Combine(testing::Values(sem::BuiltinType::kTranspose),
+                     testing::ValuesIn(Concat(TransposeCases<AFloat>(),  //
+                                              TransposeCases<f32>(),
+                                              TransposeCases<f16>()))));
+
+template <typename T>
 std::vector<Case> TruncCases() {
     std::vector<Case> cases = {C({T(0)}, T(0)),    //
                                C({-T(0)}, -T(0)),  //
diff --git a/src/tint/resolver/const_eval_test.h b/src/tint/resolver/const_eval_test.h
index 148531d..1a5ff8c 100644
--- a/src/tint/resolver/const_eval_test.h
+++ b/src/tint/resolver/const_eval_test.h
@@ -306,7 +306,17 @@
     Value<builder::mat3x2<AInt>>,
     Value<builder::mat3x2<AFloat>>,
     Value<builder::mat3x2<f32>>,
-    Value<builder::mat3x2<f16>>
+    Value<builder::mat3x2<f16>>,
+
+    Value<builder::mat2x4<AInt>>,
+    Value<builder::mat2x4<AFloat>>,
+    Value<builder::mat2x4<f32>>,
+    Value<builder::mat2x4<f16>>,
+
+    Value<builder::mat4x2<AInt>>,
+    Value<builder::mat4x2<AFloat>>,
+    Value<builder::mat4x2<f32>>,
+    Value<builder::mat4x2<f16>>
     //
     >;
 
diff --git a/src/tint/resolver/intrinsic_table.inl b/src/tint/resolver/intrinsic_table.inl
index aff12e4..f7126b1 100644
--- a/src/tint/resolver/intrinsic_table.inl
+++ b/src/tint/resolver/intrinsic_table.inl
@@ -13734,12 +13734,12 @@
     /* num parameters */ 1,
     /* num template types */ 1,
     /* num template numbers */ 2,
-    /* template types */ &kTemplateTypes[26],
+    /* template types */ &kTemplateTypes[23],
     /* template numbers */ &kTemplateNumbers[3],
     /* parameters */ &kParameters[908],
     /* return matcher indices */ &kMatcherIndices[18],
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
-    /* const eval */ nullptr,
+    /* const eval */ &ConstEval::transpose,
   },
   {
     /* [452] */
@@ -14518,7 +14518,7 @@
   },
   {
     /* [78] */
-    /* fn transpose<M : num, N : num, T : f32_f16>(mat<M, N, T>) -> mat<N, M, T> */
+    /* fn transpose<M : num, N : num, T : fa_f32_f16>(mat<M, N, T>) -> mat<N, M, T> */
     /* num overloads */ 1,
     /* overloads */ &kOverloads[451],
   },
diff --git a/src/tint/resolver/resolver_test_helper.h b/src/tint/resolver/resolver_test_helper.h
index 57fe14a..41b08b3 100644
--- a/src/tint/resolver/resolver_test_helper.h
+++ b/src/tint/resolver/resolver_test_helper.h
@@ -151,6 +151,12 @@
 using mat3x2 = mat<3, 2, T>;
 
 template <typename T>
+using mat2x4 = mat<2, 4, T>;
+
+template <typename T>
+using mat4x2 = mat<4, 2, T>;
+
+template <typename T>
 using mat3x3 = mat<3, 3, T>;
 
 template <typename T>
diff --git a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.dxc.hlsl
index d9407ce..3977313 100644
--- a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_06794e() {
-  matrix<float16_t, 3, 3> res = transpose(matrix<float16_t, 3, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx));
+  matrix<float16_t, 3, 3> res = matrix<float16_t, 3, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.glsl
index a860488..bceb985 100644
--- a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_06794e() {
-  f16mat3 res = transpose(f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf)));
+  f16mat3 res = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void transpose_06794e() {
-  f16mat3 res = transpose(f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf)));
+  f16mat3 res = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_06794e() {
-  f16mat3 res = transpose(f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf)));
+  f16mat3 res = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.msl
index 1a1def4..e11011f 100644
--- a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_06794e() {
-  half3x3 res = transpose(half3x3(half3(1.0h), half3(1.0h), half3(1.0h)));
+  half3x3 res = half3x3(half3(1.0h), half3(1.0h), half3(1.0h));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.spvasm
index 7c401d5..03c5725 100644
--- a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -38,38 +38,37 @@
      %v3half = OpTypeVector %half 3
  %mat3v3half = OpTypeMatrix %v3half 3
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %19 = OpConstantComposite %mat3v3half %18 %18 %18
+         %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %18 = OpConstantComposite %mat3v3half %17 %17 %17
 %_ptr_Function_mat3v3half = OpTypePointer Function %mat3v3half
-         %22 = OpConstantNull %mat3v3half
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %mat3v3half
+         %22 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %transpose_06794e = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat3v3half Function %22
-         %13 = OpTranspose %mat3v3half %19
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat3v3half Function %21
+               OpStore %res %18
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %transpose_06794e
+%vertex_main_inner = OpFunction %v4float None %22
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %transpose_06794e
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+         %27 = OpLabel
+         %28 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %28
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_06794e
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_06794e
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %transpose_06794e
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %transpose_06794e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.dxc.hlsl
index 3c766c6..d86773b 100644
--- a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_2585cd() {
-  float3x4 res = transpose(float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx));
+  float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.fxc.hlsl
index 3c766c6..d86773b 100644
--- a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_2585cd() {
-  float3x4 res = transpose(float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx));
+  float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.glsl
index f44eac2..60836cf 100644
--- a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void transpose_2585cd() {
-  mat3x4 res = transpose(mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f)));
+  mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void transpose_2585cd() {
-  mat3x4 res = transpose(mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f)));
+  mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void transpose_2585cd() {
-  mat3x4 res = transpose(mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f)));
+  mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.msl
index eb93f49..f0936d5 100644
--- a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_2585cd() {
-  float3x4 res = transpose(float4x3(float3(1.0f), float3(1.0f), float3(1.0f), float3(1.0f)));
+  float3x4 res = float3x4(float4(1.0f), float4(1.0f), float4(1.0f));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.spvasm
index 09bb202..4925227 100644
--- a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -31,40 +31,37 @@
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
 %mat3v4float = OpTypeMatrix %v4float 3
-    %v3float = OpTypeVector %float 3
-%mat4v3float = OpTypeMatrix %v3float 4
     %float_1 = OpConstant %float 1
-         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
-         %19 = OpConstantComposite %mat4v3float %18 %18 %18 %18
+         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %16 = OpConstantComposite %mat3v4float %15 %15 %15
 %_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
-         %22 = OpConstantNull %mat3v4float
-         %23 = OpTypeFunction %v4float
+         %19 = OpConstantNull %mat3v4float
+         %20 = OpTypeFunction %v4float
 %transpose_2585cd = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat3v4float Function %22
-         %13 = OpTranspose %mat3v4float %19
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat3v4float Function %19
+               OpStore %res %16
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %transpose_2585cd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %transpose_2585cd
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+         %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 %transpose_2585cd
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %transpose_2585cd
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_2585cd
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_2585cd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.dxc.hlsl
index 8e9cca2..efb6810 100644
--- a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_31d679() {
-  float2x2 res = transpose(float2x2((1.0f).xx, (1.0f).xx));
+  float2x2 res = float2x2((1.0f).xx, (1.0f).xx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.fxc.hlsl
index 8e9cca2..efb6810 100644
--- a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_31d679() {
-  float2x2 res = transpose(float2x2((1.0f).xx, (1.0f).xx));
+  float2x2 res = float2x2((1.0f).xx, (1.0f).xx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.glsl
index efcfb50..6e858e6 100644
--- a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void transpose_31d679() {
-  mat2 res = transpose(mat2(vec2(1.0f), vec2(1.0f)));
+  mat2 res = mat2(vec2(1.0f), vec2(1.0f));
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void transpose_31d679() {
-  mat2 res = transpose(mat2(vec2(1.0f), vec2(1.0f)));
+  mat2 res = mat2(vec2(1.0f), vec2(1.0f));
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void transpose_31d679() {
-  mat2 res = transpose(mat2(vec2(1.0f), vec2(1.0f)));
+  mat2 res = mat2(vec2(1.0f), vec2(1.0f));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.msl
index d189400..6170477 100644
--- a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_31d679() {
-  float2x2 res = transpose(float2x2(float2(1.0f), float2(1.0f)));
+  float2x2 res = float2x2(float2(1.0f), float2(1.0f));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.spvasm
index 71a0a68..0c2a9ca 100644
--- a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/31d679.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,37 +33,36 @@
     %v2float = OpTypeVector %float 2
 %mat2v2float = OpTypeMatrix %v2float 2
     %float_1 = OpConstant %float 1
-         %17 = OpConstantComposite %v2float %float_1 %float_1
-         %18 = OpConstantComposite %mat2v2float %17 %17
+         %16 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %mat2v2float %16 %16
 %_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
-         %21 = OpConstantNull %mat2v2float
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %mat2v2float
+         %21 = OpTypeFunction %v4float
 %transpose_31d679 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat2v2float Function %21
-         %13 = OpTranspose %mat2v2float %18
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat2v2float Function %20
+               OpStore %res %17
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %transpose_31d679
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_31d679
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %transpose_31d679
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_31d679
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %transpose_31d679
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_31d679
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.dxc.hlsl
index f6023f7..387bd69 100644
--- a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_31e37e() {
-  float2x4 res = transpose(float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx));
+  float2x4 res = float2x4((1.0f).xxxx, (1.0f).xxxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.fxc.hlsl
index f6023f7..387bd69 100644
--- a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_31e37e() {
-  float2x4 res = transpose(float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx));
+  float2x4 res = float2x4((1.0f).xxxx, (1.0f).xxxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.glsl
index b6aa71b..031e2ab 100644
--- a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void transpose_31e37e() {
-  mat2x4 res = transpose(mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f)));
+  mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void transpose_31e37e() {
-  mat2x4 res = transpose(mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f)));
+  mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void transpose_31e37e() {
-  mat2x4 res = transpose(mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f)));
+  mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.msl
index b724f69..8cbf0ed 100644
--- a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_31e37e() {
-  float2x4 res = transpose(float4x2(float2(1.0f), float2(1.0f), float2(1.0f), float2(1.0f)));
+  float2x4 res = float2x4(float4(1.0f), float4(1.0f));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.spvasm
index 95213d8..3f0ece2 100644
--- a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -31,40 +31,37 @@
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
 %mat2v4float = OpTypeMatrix %v4float 2
-    %v2float = OpTypeVector %float 2
-%mat4v2float = OpTypeMatrix %v2float 4
     %float_1 = OpConstant %float 1
-         %18 = OpConstantComposite %v2float %float_1 %float_1
-         %19 = OpConstantComposite %mat4v2float %18 %18 %18 %18
+         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %16 = OpConstantComposite %mat2v4float %15 %15
 %_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
-         %22 = OpConstantNull %mat2v4float
-         %23 = OpTypeFunction %v4float
+         %19 = OpConstantNull %mat2v4float
+         %20 = OpTypeFunction %v4float
 %transpose_31e37e = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat2v4float Function %22
-         %13 = OpTranspose %mat2v4float %19
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat2v4float Function %19
+               OpStore %res %16
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %transpose_31e37e
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %transpose_31e37e
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+         %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 %transpose_31e37e
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %transpose_31e37e
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_31e37e
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_31e37e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/32dd64.wgsl b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl
new file mode 100644
index 0000000..3efd9cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/32dd64.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 transpose(mat<3, 4, fa>) -> mat<4, 3, fa>
+fn transpose_32dd64() {
+  var res = transpose(mat3x4(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_32dd64();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_32dd64();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_32dd64();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..eb895be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_32dd64() {
+  float4x3 res = float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_32dd64();
+  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() {
+  transpose_32dd64();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_32dd64();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..eb895be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_32dd64() {
+  float4x3 res = float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_32dd64();
+  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() {
+  transpose_32dd64();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_32dd64();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.glsl
new file mode 100644
index 0000000..4fdd5cf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_32dd64() {
+  mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_32dd64();
+  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 transpose_32dd64() {
+  mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
+}
+
+void fragment_main() {
+  transpose_32dd64();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_32dd64() {
+  mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
+}
+
+void compute_main() {
+  transpose_32dd64();
+}
+
+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/transpose/32dd64.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.msl
new file mode 100644
index 0000000..fa8254f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_32dd64() {
+  float4x3 res = float4x3(float3(1.0f), float3(1.0f), float3(1.0f), float3(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_32dd64();
+  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() {
+  transpose_32dd64();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_32dd64();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.spvasm
new file mode 100644
index 0000000..0868d05
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/32dd64.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 %transpose_32dd64 "transpose_32dd64"
+               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
+%mat4v3float = OpTypeMatrix %v3float 4
+    %float_1 = OpConstant %float 1
+         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %mat4v3float %16 %16 %16 %16
+%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
+         %20 = OpConstantNull %mat4v3float
+         %21 = OpTypeFunction %v4float
+%transpose_32dd64 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat4v3float Function %20
+               OpStore %res %17
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_32dd64
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_32dd64
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_32dd64
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.wgsl
new file mode 100644
index 0000000..d99472b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn transpose_32dd64() {
+  var res = transpose(mat3x4(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_32dd64();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_32dd64();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_32dd64();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.dxc.hlsl
index b941117..a3c33b4 100644
--- a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_4ce359() {
-  float4x2 res = transpose(float2x4((1.0f).xxxx, (1.0f).xxxx));
+  float4x2 res = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.fxc.hlsl
index b941117..a3c33b4 100644
--- a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_4ce359() {
-  float4x2 res = transpose(float2x4((1.0f).xxxx, (1.0f).xxxx));
+  float4x2 res = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.glsl
index 03e01ec..101eec8 100644
--- a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void transpose_4ce359() {
-  mat4x2 res = transpose(mat2x4(vec4(1.0f), vec4(1.0f)));
+  mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void transpose_4ce359() {
-  mat4x2 res = transpose(mat2x4(vec4(1.0f), vec4(1.0f)));
+  mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void transpose_4ce359() {
-  mat4x2 res = transpose(mat2x4(vec4(1.0f), vec4(1.0f)));
+  mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.msl
index 42cafca..150821f 100644
--- a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_4ce359() {
-  float4x2 res = transpose(float2x4(float4(1.0f), float4(1.0f)));
+  float4x2 res = float4x2(float2(1.0f), float2(1.0f), float2(1.0f), float2(1.0f));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.spvasm
index e36521c..96c31a9 100644
--- a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -32,39 +32,37 @@
           %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
 %mat4v2float = OpTypeMatrix %v2float 4
-%mat2v4float = OpTypeMatrix %v4float 2
     %float_1 = OpConstant %float 1
-         %18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
-         %19 = OpConstantComposite %mat2v4float %18 %18
+         %16 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %mat4v2float %16 %16 %16 %16
 %_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
-         %22 = OpConstantNull %mat4v2float
-         %23 = OpTypeFunction %v4float
+         %20 = OpConstantNull %mat4v2float
+         %21 = OpTypeFunction %v4float
 %transpose_4ce359 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat4v2float Function %22
-         %13 = OpTranspose %mat4v2float %19
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat4v2float Function %20
+               OpStore %res %17
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %transpose_4ce359
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_4ce359
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_4ce359
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_4ce359
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_4ce359
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_4ce359
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.dxc.hlsl
index 401f940..2f3ba72 100644
--- a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_4dc9a1() {
-  float3x2 res = transpose(float2x3((1.0f).xxx, (1.0f).xxx));
+  float3x2 res = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.fxc.hlsl
index 401f940..2f3ba72 100644
--- a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_4dc9a1() {
-  float3x2 res = transpose(float2x3((1.0f).xxx, (1.0f).xxx));
+  float3x2 res = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.glsl
index e9e8cdf..81feae0 100644
--- a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void transpose_4dc9a1() {
-  mat3x2 res = transpose(mat2x3(vec3(1.0f), vec3(1.0f)));
+  mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void transpose_4dc9a1() {
-  mat3x2 res = transpose(mat2x3(vec3(1.0f), vec3(1.0f)));
+  mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void transpose_4dc9a1() {
-  mat3x2 res = transpose(mat2x3(vec3(1.0f), vec3(1.0f)));
+  mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.msl
index 3332123..b1d4d7a 100644
--- a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_4dc9a1() {
-  float3x2 res = transpose(float2x3(float3(1.0f), float3(1.0f)));
+  float3x2 res = float3x2(float2(1.0f), float2(1.0f), float2(1.0f));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.spvasm
index ed04764..725a125 100644
--- a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -32,40 +32,37 @@
           %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
 %mat3v2float = OpTypeMatrix %v2float 3
-    %v3float = OpTypeVector %float 3
-%mat2v3float = OpTypeMatrix %v3float 2
     %float_1 = OpConstant %float 1
-         %19 = OpConstantComposite %v3float %float_1 %float_1 %float_1
-         %20 = OpConstantComposite %mat2v3float %19 %19
+         %16 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %mat3v2float %16 %16 %16
 %_ptr_Function_mat3v2float = OpTypePointer Function %mat3v2float
-         %23 = OpConstantNull %mat3v2float
-         %24 = OpTypeFunction %v4float
+         %20 = OpConstantNull %mat3v2float
+         %21 = OpTypeFunction %v4float
 %transpose_4dc9a1 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat3v2float Function %23
-         %13 = OpTranspose %mat3v2float %20
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat3v2float Function %20
+               OpStore %res %17
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %transpose_4dc9a1
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_4dc9a1
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_4dc9a1
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_4dc9a1
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %transpose_4dc9a1
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_4dc9a1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/553e90.wgsl b/test/tint/builtins/gen/literal/transpose/553e90.wgsl
new file mode 100644
index 0000000..5eb0ace
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/553e90.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 transpose(mat<4, 2, fa>) -> mat<2, 4, fa>
+fn transpose_553e90() {
+  var res = transpose(mat4x2(1., 1., 1., 1., 1., 1., 1., 1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_553e90();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_553e90();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_553e90();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..eb7293b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_553e90() {
+  float2x4 res = float2x4((1.0f).xxxx, (1.0f).xxxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_553e90();
+  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() {
+  transpose_553e90();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_553e90();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..eb7293b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_553e90() {
+  float2x4 res = float2x4((1.0f).xxxx, (1.0f).xxxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_553e90();
+  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() {
+  transpose_553e90();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_553e90();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.glsl
new file mode 100644
index 0000000..8c4e25d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_553e90() {
+  mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_553e90();
+  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 transpose_553e90() {
+  mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
+}
+
+void fragment_main() {
+  transpose_553e90();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_553e90() {
+  mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
+}
+
+void compute_main() {
+  transpose_553e90();
+}
+
+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/transpose/553e90.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.msl
new file mode 100644
index 0000000..16fe599
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_553e90() {
+  float2x4 res = float2x4(float4(1.0f), float4(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_553e90();
+  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() {
+  transpose_553e90();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_553e90();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.spvasm
new file mode 100644
index 0000000..0b258fe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; 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 %transpose_553e90 "transpose_553e90"
+               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
+%mat2v4float = OpTypeMatrix %v4float 2
+    %float_1 = OpConstant %float 1
+         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %16 = OpConstantComposite %mat2v4float %15 %15
+%_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
+         %19 = OpConstantNull %mat2v4float
+         %20 = OpTypeFunction %v4float
+%transpose_553e90 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat2v4float Function %19
+               OpStore %res %16
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %transpose_553e90
+               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
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %transpose_553e90
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_553e90
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.wgsl
new file mode 100644
index 0000000..6b4311e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/553e90.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn transpose_553e90() {
+  var res = transpose(mat4x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_553e90();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_553e90();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_553e90();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/5c133c.wgsl b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl
new file mode 100644
index 0000000..487aad8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/5c133c.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 transpose(mat<4, 3, fa>) -> mat<3, 4, fa>
+fn transpose_5c133c() {
+  var res = transpose(mat4x3(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_5c133c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_5c133c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_5c133c();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9db91a8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_5c133c() {
+  float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_5c133c();
+  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() {
+  transpose_5c133c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_5c133c();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9db91a8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_5c133c() {
+  float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_5c133c();
+  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() {
+  transpose_5c133c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_5c133c();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.glsl
new file mode 100644
index 0000000..1a04ea6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_5c133c() {
+  mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_5c133c();
+  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 transpose_5c133c() {
+  mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
+}
+
+void fragment_main() {
+  transpose_5c133c();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_5c133c() {
+  mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
+}
+
+void compute_main() {
+  transpose_5c133c();
+}
+
+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/transpose/5c133c.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.msl
new file mode 100644
index 0000000..c8338d3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_5c133c() {
+  float3x4 res = float3x4(float4(1.0f), float4(1.0f), float4(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_5c133c();
+  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() {
+  transpose_5c133c();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_5c133c();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.spvasm
new file mode 100644
index 0000000..a3908ba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; 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 %transpose_5c133c "transpose_5c133c"
+               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
+%mat3v4float = OpTypeMatrix %v4float 3
+    %float_1 = OpConstant %float 1
+         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %16 = OpConstantComposite %mat3v4float %15 %15 %15
+%_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
+         %19 = OpConstantNull %mat3v4float
+         %20 = OpTypeFunction %v4float
+%transpose_5c133c = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat3v4float Function %19
+               OpStore %res %16
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %transpose_5c133c
+               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
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %transpose_5c133c
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_5c133c
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.wgsl
new file mode 100644
index 0000000..6631dd6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn transpose_5c133c() {
+  var res = transpose(mat4x3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_5c133c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_5c133c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_5c133c();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.dxc.hlsl
index 3c9585c..736166a 100644
--- a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_5edd96() {
-  matrix<float16_t, 2, 4> res = transpose(matrix<float16_t, 4, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx));
+  matrix<float16_t, 2, 4> res = matrix<float16_t, 2, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.glsl
index d0deba2..f2c3448 100644
--- a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_5edd96() {
-  f16mat2x4 res = transpose(f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf)));
+  f16mat2x4 res = f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf));
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void transpose_5edd96() {
-  f16mat2x4 res = transpose(f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf)));
+  f16mat2x4 res = f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf));
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_5edd96() {
-  f16mat2x4 res = transpose(f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf)));
+  f16mat2x4 res = f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.msl
index 538c05a..9e612d6 100644
--- a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_5edd96() {
-  half2x4 res = transpose(half4x2(half2(1.0h), half2(1.0h), half2(1.0h), half2(1.0h)));
+  half2x4 res = half2x4(half4(1.0h), half4(1.0h));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.spvasm
index c85cda1..603fe36 100644
--- a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -37,41 +37,38 @@
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
  %mat2v4half = OpTypeMatrix %v4half 2
-     %v2half = OpTypeVector %half 2
- %mat4v2half = OpTypeMatrix %v2half 4
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %20 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
-         %21 = OpConstantComposite %mat4v2half %20 %20 %20 %20
+         %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %18 = OpConstantComposite %mat2v4half %17 %17
 %_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
-         %24 = OpConstantNull %mat2v4half
-         %25 = OpTypeFunction %v4float
+         %21 = OpConstantNull %mat2v4half
+         %22 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %transpose_5edd96 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat2v4half Function %24
-         %13 = OpTranspose %mat2v4half %21
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat2v4half Function %21
+               OpStore %res %18
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %transpose_5edd96
+%vertex_main_inner = OpFunction %v4float None %22
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %transpose_5edd96
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+         %27 = OpLabel
+         %28 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %28
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_5edd96
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_5edd96
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %transpose_5edd96
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %transpose_5edd96
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.dxc.hlsl
index cda6242..6bef090 100644
--- a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_5f36bf() {
-  matrix<float16_t, 3, 4> res = transpose(matrix<float16_t, 4, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx));
+  matrix<float16_t, 3, 4> res = matrix<float16_t, 3, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.glsl
index 6aba0b9..6e78f07 100644
--- a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_5f36bf() {
-  f16mat3x4 res = transpose(f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf)));
+  f16mat3x4 res = f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void transpose_5f36bf() {
-  f16mat3x4 res = transpose(f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf)));
+  f16mat3x4 res = f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_5f36bf() {
-  f16mat3x4 res = transpose(f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf)));
+  f16mat3x4 res = f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.msl
index 0545295..7e141f9 100644
--- a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_5f36bf() {
-  half3x4 res = transpose(half4x3(half3(1.0h), half3(1.0h), half3(1.0h), half3(1.0h)));
+  half3x4 res = half3x4(half4(1.0h), half4(1.0h), half4(1.0h));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.spvasm
index 1283679..08bc2fd 100644
--- a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -37,41 +37,38 @@
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
  %mat3v4half = OpTypeMatrix %v4half 3
-     %v3half = OpTypeVector %half 3
- %mat4v3half = OpTypeMatrix %v3half 4
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %20 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %21 = OpConstantComposite %mat4v3half %20 %20 %20 %20
+         %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %18 = OpConstantComposite %mat3v4half %17 %17 %17
 %_ptr_Function_mat3v4half = OpTypePointer Function %mat3v4half
-         %24 = OpConstantNull %mat3v4half
-         %25 = OpTypeFunction %v4float
+         %21 = OpConstantNull %mat3v4half
+         %22 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %transpose_5f36bf = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat3v4half Function %24
-         %13 = OpTranspose %mat3v4half %21
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat3v4half Function %21
+               OpStore %res %18
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %transpose_5f36bf
+%vertex_main_inner = OpFunction %v4float None %22
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %transpose_5f36bf
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+         %27 = OpLabel
+         %28 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %28
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_5f36bf
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_5f36bf
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %transpose_5f36bf
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %transpose_5f36bf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/66fce8.wgsl b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl
new file mode 100644
index 0000000..51e7da6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/66fce8.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 transpose(mat<3, 3, fa>) -> mat<3, 3, fa>
+fn transpose_66fce8() {
+  var res = transpose(mat3x3(1., 1., 1., 1., 1., 1., 1., 1., 1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_66fce8();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_66fce8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_66fce8();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..604b6c5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_66fce8() {
+  float3x3 res = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_66fce8();
+  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() {
+  transpose_66fce8();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_66fce8();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..604b6c5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_66fce8() {
+  float3x3 res = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_66fce8();
+  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() {
+  transpose_66fce8();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_66fce8();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.glsl
new file mode 100644
index 0000000..7abc811
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_66fce8() {
+  mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_66fce8();
+  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 transpose_66fce8() {
+  mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
+}
+
+void fragment_main() {
+  transpose_66fce8();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_66fce8() {
+  mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
+}
+
+void compute_main() {
+  transpose_66fce8();
+}
+
+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/transpose/66fce8.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.msl
new file mode 100644
index 0000000..230466c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_66fce8() {
+  float3x3 res = float3x3(float3(1.0f), float3(1.0f), float3(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_66fce8();
+  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() {
+  transpose_66fce8();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_66fce8();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.spvasm
new file mode 100644
index 0000000..2a807d4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/66fce8.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 %transpose_66fce8 "transpose_66fce8"
+               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
+%mat3v3float = OpTypeMatrix %v3float 3
+    %float_1 = OpConstant %float 1
+         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %mat3v3float %16 %16 %16
+%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
+         %20 = OpConstantNull %mat3v3float
+         %21 = OpTypeFunction %v4float
+%transpose_66fce8 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat3v3float Function %20
+               OpStore %res %17
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_66fce8
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_66fce8
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_66fce8
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.wgsl
new file mode 100644
index 0000000..4f74acf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn transpose_66fce8() {
+  var res = transpose(mat3x3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_66fce8();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_66fce8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_66fce8();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/70ca11.wgsl b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl
new file mode 100644
index 0000000..7ef92e5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/70ca11.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 transpose(mat<2, 3, fa>) -> mat<3, 2, fa>
+fn transpose_70ca11() {
+  var res = transpose(mat2x3(1., 1., 1., 1., 1., 1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_70ca11();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_70ca11();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_70ca11();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ce7b788
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_70ca11() {
+  float3x2 res = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_70ca11();
+  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() {
+  transpose_70ca11();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_70ca11();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ce7b788
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_70ca11() {
+  float3x2 res = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_70ca11();
+  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() {
+  transpose_70ca11();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_70ca11();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.glsl
new file mode 100644
index 0000000..5f8dd67
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_70ca11() {
+  mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_70ca11();
+  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 transpose_70ca11() {
+  mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
+}
+
+void fragment_main() {
+  transpose_70ca11();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_70ca11() {
+  mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
+}
+
+void compute_main() {
+  transpose_70ca11();
+}
+
+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/transpose/70ca11.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.msl
new file mode 100644
index 0000000..89a2e00
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_70ca11() {
+  float3x2 res = float3x2(float2(1.0f), float2(1.0f), float2(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_70ca11();
+  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() {
+  transpose_70ca11();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_70ca11();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.spvasm
new file mode 100644
index 0000000..346c295
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/70ca11.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 %transpose_70ca11 "transpose_70ca11"
+               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
+%mat3v2float = OpTypeMatrix %v2float 3
+    %float_1 = OpConstant %float 1
+         %16 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %mat3v2float %16 %16 %16
+%_ptr_Function_mat3v2float = OpTypePointer Function %mat3v2float
+         %20 = OpConstantNull %mat3v2float
+         %21 = OpTypeFunction %v4float
+%transpose_70ca11 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat3v2float Function %20
+               OpStore %res %17
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_70ca11
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_70ca11
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_70ca11
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.wgsl
new file mode 100644
index 0000000..5093cd0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn transpose_70ca11() {
+  var res = transpose(mat2x3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_70ca11();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_70ca11();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_70ca11();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.dxc.hlsl
index cfa9885..08cac08 100644
--- a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_7be8b2() {
-  matrix<float16_t, 2, 2> res = transpose(matrix<float16_t, 2, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx));
+  matrix<float16_t, 2, 2> res = matrix<float16_t, 2, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.glsl
index 1d16a91..db2a179 100644
--- a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_7be8b2() {
-  f16mat2 res = transpose(f16mat2(f16vec2(1.0hf), f16vec2(1.0hf)));
+  f16mat2 res = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void transpose_7be8b2() {
-  f16mat2 res = transpose(f16mat2(f16vec2(1.0hf), f16vec2(1.0hf)));
+  f16mat2 res = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_7be8b2() {
-  f16mat2 res = transpose(f16mat2(f16vec2(1.0hf), f16vec2(1.0hf)));
+  f16mat2 res = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.msl
index 68fc99b..90e5d8a 100644
--- a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_7be8b2() {
-  half2x2 res = transpose(half2x2(half2(1.0h), half2(1.0h)));
+  half2x2 res = half2x2(half2(1.0h), half2(1.0h));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.spvasm
index 8c0e82a..05c185c 100644
--- a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -38,38 +38,37 @@
      %v2half = OpTypeVector %half 2
  %mat2v2half = OpTypeMatrix %v2half 2
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %18 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
-         %19 = OpConstantComposite %mat2v2half %18 %18
+         %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %18 = OpConstantComposite %mat2v2half %17 %17
 %_ptr_Function_mat2v2half = OpTypePointer Function %mat2v2half
-         %22 = OpConstantNull %mat2v2half
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %mat2v2half
+         %22 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %transpose_7be8b2 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat2v2half Function %22
-         %13 = OpTranspose %mat2v2half %19
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat2v2half Function %21
+               OpStore %res %18
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %transpose_7be8b2
+%vertex_main_inner = OpFunction %v4float None %22
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %transpose_7be8b2
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+         %27 = OpLabel
+         %28 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %28
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_7be8b2
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_7be8b2
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %transpose_7be8b2
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %transpose_7be8b2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl
new file mode 100644
index 0000000..84f0709
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/7eb2c5.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 transpose(mat<2, 2, fa>) -> mat<2, 2, fa>
+fn transpose_7eb2c5() {
+  var res = transpose(mat2x2(1., 1., 1., 1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_7eb2c5();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_7eb2c5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_7eb2c5();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f44fa67
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_7eb2c5() {
+  float2x2 res = float2x2((1.0f).xx, (1.0f).xx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_7eb2c5();
+  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() {
+  transpose_7eb2c5();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_7eb2c5();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f44fa67
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_7eb2c5() {
+  float2x2 res = float2x2((1.0f).xx, (1.0f).xx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_7eb2c5();
+  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() {
+  transpose_7eb2c5();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_7eb2c5();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.glsl
new file mode 100644
index 0000000..069cce3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_7eb2c5() {
+  mat2 res = mat2(vec2(1.0f), vec2(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_7eb2c5();
+  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 transpose_7eb2c5() {
+  mat2 res = mat2(vec2(1.0f), vec2(1.0f));
+}
+
+void fragment_main() {
+  transpose_7eb2c5();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_7eb2c5() {
+  mat2 res = mat2(vec2(1.0f), vec2(1.0f));
+}
+
+void compute_main() {
+  transpose_7eb2c5();
+}
+
+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/transpose/7eb2c5.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.msl
new file mode 100644
index 0000000..857b8f5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_7eb2c5() {
+  float2x2 res = float2x2(float2(1.0f), float2(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_7eb2c5();
+  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() {
+  transpose_7eb2c5();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_7eb2c5();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.spvasm
new file mode 100644
index 0000000..ab62733
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/7eb2c5.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 %transpose_7eb2c5 "transpose_7eb2c5"
+               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
+%mat2v2float = OpTypeMatrix %v2float 2
+    %float_1 = OpConstant %float 1
+         %16 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %mat2v2float %16 %16
+%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
+         %20 = OpConstantNull %mat2v2float
+         %21 = OpTypeFunction %v4float
+%transpose_7eb2c5 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat2v2float Function %20
+               OpStore %res %17
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_7eb2c5
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_7eb2c5
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_7eb2c5
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.wgsl
new file mode 100644
index 0000000..f6c13ea
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn transpose_7eb2c5() {
+  var res = transpose(mat2x2(1.0, 1.0, 1.0, 1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_7eb2c5();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_7eb2c5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_7eb2c5();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.dxc.hlsl
index f1af6cb..ec32137 100644
--- a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_844869() {
-  matrix<float16_t, 4, 4> res = transpose(matrix<float16_t, 4, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx));
+  matrix<float16_t, 4, 4> res = matrix<float16_t, 4, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.glsl
index 46d711b..6fd102a 100644
--- a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_844869() {
-  f16mat4 res = transpose(f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf)));
+  f16mat4 res = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void transpose_844869() {
-  f16mat4 res = transpose(f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf)));
+  f16mat4 res = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_844869() {
-  f16mat4 res = transpose(f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf)));
+  f16mat4 res = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.msl
index 0b18d45..fe21910 100644
--- a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_844869() {
-  half4x4 res = transpose(half4x4(half4(1.0h), half4(1.0h), half4(1.0h), half4(1.0h)));
+  half4x4 res = half4x4(half4(1.0h), half4(1.0h), half4(1.0h), half4(1.0h));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.spvasm
index 342309f..3364395 100644
--- a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -38,38 +38,37 @@
      %v4half = OpTypeVector %half 4
  %mat4v4half = OpTypeMatrix %v4half 4
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %18 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %19 = OpConstantComposite %mat4v4half %18 %18 %18 %18
+         %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %18 = OpConstantComposite %mat4v4half %17 %17 %17 %17
 %_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
-         %22 = OpConstantNull %mat4v4half
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %mat4v4half
+         %22 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %transpose_844869 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat4v4half Function %22
-         %13 = OpTranspose %mat4v4half %19
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat4v4half Function %21
+               OpStore %res %18
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %transpose_844869
+%vertex_main_inner = OpFunction %v4float None %22
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %transpose_844869
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+         %27 = OpLabel
+         %28 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %28
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_844869
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_844869
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %transpose_844869
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %transpose_844869
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/84a763.wgsl b/test/tint/builtins/gen/literal/transpose/84a763.wgsl
new file mode 100644
index 0000000..a965485
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/84a763.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 transpose(mat<2, 4, fa>) -> mat<4, 2, fa>
+fn transpose_84a763() {
+  var res = transpose(mat2x4(1., 1., 1., 1., 1., 1., 1., 1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_84a763();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_84a763();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_84a763();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..600c218
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_84a763() {
+  float4x2 res = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_84a763();
+  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() {
+  transpose_84a763();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_84a763();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..600c218
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_84a763() {
+  float4x2 res = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_84a763();
+  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() {
+  transpose_84a763();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_84a763();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.glsl
new file mode 100644
index 0000000..17c5103
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_84a763() {
+  mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_84a763();
+  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 transpose_84a763() {
+  mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
+}
+
+void fragment_main() {
+  transpose_84a763();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_84a763() {
+  mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
+}
+
+void compute_main() {
+  transpose_84a763();
+}
+
+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/transpose/84a763.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.msl
new file mode 100644
index 0000000..ae97507
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_84a763() {
+  float4x2 res = float4x2(float2(1.0f), float2(1.0f), float2(1.0f), float2(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_84a763();
+  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() {
+  transpose_84a763();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_84a763();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.spvasm
new file mode 100644
index 0000000..ee63dc0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/84a763.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 %transpose_84a763 "transpose_84a763"
+               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
+%mat4v2float = OpTypeMatrix %v2float 4
+    %float_1 = OpConstant %float 1
+         %16 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %mat4v2float %16 %16 %16 %16
+%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
+         %20 = OpConstantNull %mat4v2float
+         %21 = OpTypeFunction %v4float
+%transpose_84a763 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat4v2float Function %20
+               OpStore %res %17
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_84a763
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_84a763
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_84a763
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.wgsl
new file mode 100644
index 0000000..5aaec12
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/84a763.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn transpose_84a763() {
+  var res = transpose(mat2x4(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_84a763();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_84a763();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_84a763();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.dxc.hlsl
index f625b2e..b094732 100644
--- a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_854336() {
-  float3x3 res = transpose(float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx));
+  float3x3 res = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.fxc.hlsl
index f625b2e..b094732 100644
--- a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_854336() {
-  float3x3 res = transpose(float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx));
+  float3x3 res = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.glsl
index 3673f90..5092a2e 100644
--- a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void transpose_854336() {
-  mat3 res = transpose(mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f)));
+  mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void transpose_854336() {
-  mat3 res = transpose(mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f)));
+  mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void transpose_854336() {
-  mat3 res = transpose(mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f)));
+  mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.msl
index 2f76c10..13b5c65 100644
--- a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_854336() {
-  float3x3 res = transpose(float3x3(float3(1.0f), float3(1.0f), float3(1.0f)));
+  float3x3 res = float3x3(float3(1.0f), float3(1.0f), float3(1.0f));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.spvasm
index 557e008..3d93f98 100644
--- a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/854336.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,37 +33,36 @@
     %v3float = OpTypeVector %float 3
 %mat3v3float = OpTypeMatrix %v3float 3
     %float_1 = OpConstant %float 1
-         %17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
-         %18 = OpConstantComposite %mat3v3float %17 %17 %17
+         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %mat3v3float %16 %16 %16
 %_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
-         %21 = OpConstantNull %mat3v3float
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %mat3v3float
+         %21 = OpTypeFunction %v4float
 %transpose_854336 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat3v3float Function %21
-         %13 = OpTranspose %mat3v3float %18
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat3v3float Function %20
+               OpStore %res %17
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %transpose_854336
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_854336
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %transpose_854336
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_854336
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %transpose_854336
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_854336
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.dxc.hlsl
index d0ed0a2..fbbd86d 100644
--- a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_8c06ce() {
-  matrix<float16_t, 4, 3> res = transpose(matrix<float16_t, 3, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx));
+  matrix<float16_t, 4, 3> res = matrix<float16_t, 4, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.glsl
index aebf782..439264c 100644
--- a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_8c06ce() {
-  f16mat4x3 res = transpose(f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf)));
+  f16mat4x3 res = f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void transpose_8c06ce() {
-  f16mat4x3 res = transpose(f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf)));
+  f16mat4x3 res = f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_8c06ce() {
-  f16mat4x3 res = transpose(f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf)));
+  f16mat4x3 res = f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.msl
index 1b191a2..3144e11 100644
--- a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_8c06ce() {
-  half4x3 res = transpose(half3x4(half4(1.0h), half4(1.0h), half4(1.0h)));
+  half4x3 res = half4x3(half3(1.0h), half3(1.0h), half3(1.0h), half3(1.0h));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.spvasm
index 2f35c48..ef9708c 100644
--- a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -37,41 +37,38 @@
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
  %mat4v3half = OpTypeMatrix %v3half 4
-     %v4half = OpTypeVector %half 4
- %mat3v4half = OpTypeMatrix %v4half 3
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %20 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %21 = OpConstantComposite %mat3v4half %20 %20 %20
+         %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %18 = OpConstantComposite %mat4v3half %17 %17 %17 %17
 %_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
-         %24 = OpConstantNull %mat4v3half
-         %25 = OpTypeFunction %v4float
+         %21 = OpConstantNull %mat4v3half
+         %22 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %transpose_8c06ce = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat4v3half Function %24
-         %13 = OpTranspose %mat4v3half %21
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat4v3half Function %21
+               OpStore %res %18
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %transpose_8c06ce
+%vertex_main_inner = OpFunction %v4float None %22
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %transpose_8c06ce
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+         %27 = OpLabel
+         %28 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %28
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_8c06ce
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_8c06ce
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %transpose_8c06ce
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %transpose_8c06ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/ace596.wgsl b/test/tint/builtins/gen/literal/transpose/ace596.wgsl
new file mode 100644
index 0000000..b55c252
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/ace596.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 transpose(mat<3, 2, fa>) -> mat<2, 3, fa>
+fn transpose_ace596() {
+  var res = transpose(mat3x2(1., 1., 1., 1., 1., 1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_ace596();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_ace596();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_ace596();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5672d62
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_ace596() {
+  float2x3 res = float2x3((1.0f).xxx, (1.0f).xxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_ace596();
+  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() {
+  transpose_ace596();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_ace596();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5672d62
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_ace596() {
+  float2x3 res = float2x3((1.0f).xxx, (1.0f).xxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_ace596();
+  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() {
+  transpose_ace596();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_ace596();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.glsl
new file mode 100644
index 0000000..a3da82b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_ace596() {
+  mat2x3 res = mat2x3(vec3(1.0f), vec3(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_ace596();
+  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 transpose_ace596() {
+  mat2x3 res = mat2x3(vec3(1.0f), vec3(1.0f));
+}
+
+void fragment_main() {
+  transpose_ace596();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_ace596() {
+  mat2x3 res = mat2x3(vec3(1.0f), vec3(1.0f));
+}
+
+void compute_main() {
+  transpose_ace596();
+}
+
+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/transpose/ace596.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.msl
new file mode 100644
index 0000000..6618a71
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_ace596() {
+  float2x3 res = float2x3(float3(1.0f), float3(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_ace596();
+  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() {
+  transpose_ace596();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_ace596();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.spvasm
new file mode 100644
index 0000000..0ce25bd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/ace596.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 %transpose_ace596 "transpose_ace596"
+               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
+%mat2v3float = OpTypeMatrix %v3float 2
+    %float_1 = OpConstant %float 1
+         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %mat2v3float %16 %16
+%_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
+         %20 = OpConstantNull %mat2v3float
+         %21 = OpTypeFunction %v4float
+%transpose_ace596 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat2v3float Function %20
+               OpStore %res %17
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_ace596
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_ace596
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_ace596
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.wgsl
new file mode 100644
index 0000000..ed3c1db
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/ace596.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn transpose_ace596() {
+  var res = transpose(mat3x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_ace596();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_ace596();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_ace596();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.dxc.hlsl
index 1d61c25..126d8cb 100644
--- a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_b9ad1f() {
-  matrix<float16_t, 2, 3> res = transpose(matrix<float16_t, 3, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx));
+  matrix<float16_t, 2, 3> res = matrix<float16_t, 2, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.glsl
index 123e8c4..82e02e7 100644
--- a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_b9ad1f() {
-  f16mat2x3 res = transpose(f16mat3x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf)));
+  f16mat2x3 res = f16mat2x3(f16vec3(1.0hf), f16vec3(1.0hf));
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void transpose_b9ad1f() {
-  f16mat2x3 res = transpose(f16mat3x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf)));
+  f16mat2x3 res = f16mat2x3(f16vec3(1.0hf), f16vec3(1.0hf));
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_b9ad1f() {
-  f16mat2x3 res = transpose(f16mat3x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf)));
+  f16mat2x3 res = f16mat2x3(f16vec3(1.0hf), f16vec3(1.0hf));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.msl
index d449921..9d97e55 100644
--- a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_b9ad1f() {
-  half2x3 res = transpose(half3x2(half2(1.0h), half2(1.0h), half2(1.0h)));
+  half2x3 res = half2x3(half3(1.0h), half3(1.0h));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.spvasm
index 19c2897..63db7d8 100644
--- a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -37,41 +37,38 @@
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
  %mat2v3half = OpTypeMatrix %v3half 2
-     %v2half = OpTypeVector %half 2
- %mat3v2half = OpTypeMatrix %v2half 3
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %20 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
-         %21 = OpConstantComposite %mat3v2half %20 %20 %20
+         %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %18 = OpConstantComposite %mat2v3half %17 %17
 %_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
-         %24 = OpConstantNull %mat2v3half
-         %25 = OpTypeFunction %v4float
+         %21 = OpConstantNull %mat2v3half
+         %22 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %transpose_b9ad1f = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat2v3half Function %24
-         %13 = OpTranspose %mat2v3half %21
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat2v3half Function %21
+               OpStore %res %18
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %transpose_b9ad1f
+%vertex_main_inner = OpFunction %v4float None %22
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %transpose_b9ad1f
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+         %27 = OpLabel
+         %28 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %28
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_b9ad1f
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_b9ad1f
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %transpose_b9ad1f
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %transpose_b9ad1f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.dxc.hlsl
index 7d91201..d06f52d 100644
--- a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_c1b600() {
-  float4x4 res = transpose(float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx));
+  float4x4 res = float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.fxc.hlsl
index 7d91201..d06f52d 100644
--- a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_c1b600() {
-  float4x4 res = transpose(float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx));
+  float4x4 res = float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.glsl
index 3b7dd43..088adc7 100644
--- a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void transpose_c1b600() {
-  mat4 res = transpose(mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f)));
+  mat4 res = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void transpose_c1b600() {
-  mat4 res = transpose(mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f)));
+  mat4 res = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void transpose_c1b600() {
-  mat4 res = transpose(mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f)));
+  mat4 res = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.msl
index b759ef4..eedd9e4 100644
--- a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_c1b600() {
-  float4x4 res = transpose(float4x4(float4(1.0f), float4(1.0f), float4(1.0f), float4(1.0f)));
+  float4x4 res = float4x4(float4(1.0f), float4(1.0f), float4(1.0f), float4(1.0f));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.spvasm
index 966363c..8b8bf4e 100644
--- a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -32,37 +32,36 @@
           %9 = OpTypeFunction %void
 %mat4v4float = OpTypeMatrix %v4float 4
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
-         %17 = OpConstantComposite %mat4v4float %16 %16 %16 %16
+         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %16 = OpConstantComposite %mat4v4float %15 %15 %15 %15
 %_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
-         %20 = OpConstantNull %mat4v4float
-         %21 = OpTypeFunction %v4float
+         %19 = OpConstantNull %mat4v4float
+         %20 = OpTypeFunction %v4float
 %transpose_c1b600 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat4v4float Function %20
-         %13 = OpTranspose %mat4v4float %17
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat4v4float Function %19
+               OpStore %res %16
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %transpose_c1b600
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %transpose_c1b600
                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
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %transpose_c1b600
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %transpose_c1b600
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_c1b600
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_c1b600
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.dxc.hlsl
index 4baafb0..85b78fd 100644
--- a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_d6faec() {
-  matrix<float16_t, 3, 2> res = transpose(matrix<float16_t, 2, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx));
+  matrix<float16_t, 3, 2> res = matrix<float16_t, 3, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.glsl
index 3712491..6028fb6a 100644
--- a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_d6faec() {
-  f16mat3x2 res = transpose(f16mat2x3(f16vec3(1.0hf), f16vec3(1.0hf)));
+  f16mat3x2 res = f16mat3x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void transpose_d6faec() {
-  f16mat3x2 res = transpose(f16mat2x3(f16vec3(1.0hf), f16vec3(1.0hf)));
+  f16mat3x2 res = f16mat3x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_d6faec() {
-  f16mat3x2 res = transpose(f16mat2x3(f16vec3(1.0hf), f16vec3(1.0hf)));
+  f16mat3x2 res = f16mat3x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.msl
index b30b952..8b55e1a 100644
--- a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_d6faec() {
-  half3x2 res = transpose(half2x3(half3(1.0h), half3(1.0h)));
+  half3x2 res = half3x2(half2(1.0h), half2(1.0h), half2(1.0h));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.spvasm
index cbbfc9b..d5c2f0a 100644
--- a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -37,41 +37,38 @@
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
  %mat3v2half = OpTypeMatrix %v2half 3
-     %v3half = OpTypeVector %half 3
- %mat2v3half = OpTypeMatrix %v3half 2
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %20 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %21 = OpConstantComposite %mat2v3half %20 %20
+         %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %18 = OpConstantComposite %mat3v2half %17 %17 %17
 %_ptr_Function_mat3v2half = OpTypePointer Function %mat3v2half
-         %24 = OpConstantNull %mat3v2half
-         %25 = OpTypeFunction %v4float
+         %21 = OpConstantNull %mat3v2half
+         %22 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %transpose_d6faec = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat3v2half Function %24
-         %13 = OpTranspose %mat3v2half %21
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat3v2half Function %21
+               OpStore %res %18
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %transpose_d6faec
+%vertex_main_inner = OpFunction %v4float None %22
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %transpose_d6faec
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+         %27 = OpLabel
+         %28 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %28
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_d6faec
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_d6faec
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %transpose_d6faec
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %transpose_d6faec
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.dxc.hlsl
index 0a03a8d..2c8bd5d 100644
--- a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_d8f8ba() {
-  float4x3 res = transpose(float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx));
+  float4x3 res = float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.fxc.hlsl
index 0a03a8d..2c8bd5d 100644
--- a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_d8f8ba() {
-  float4x3 res = transpose(float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx));
+  float4x3 res = float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.glsl
index 46f6c33..58df856 100644
--- a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void transpose_d8f8ba() {
-  mat4x3 res = transpose(mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f)));
+  mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void transpose_d8f8ba() {
-  mat4x3 res = transpose(mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f)));
+  mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void transpose_d8f8ba() {
-  mat4x3 res = transpose(mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f)));
+  mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.msl
index 4250fcf..fa01e0a 100644
--- a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_d8f8ba() {
-  float4x3 res = transpose(float3x4(float4(1.0f), float4(1.0f), float4(1.0f)));
+  float4x3 res = float4x3(float3(1.0f), float3(1.0f), float3(1.0f), float3(1.0f));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.spvasm
index cc5b2cb..61e237e 100644
--- a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -32,39 +32,37 @@
           %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
 %mat4v3float = OpTypeMatrix %v3float 4
-%mat3v4float = OpTypeMatrix %v4float 3
     %float_1 = OpConstant %float 1
-         %18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
-         %19 = OpConstantComposite %mat3v4float %18 %18 %18
+         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %mat4v3float %16 %16 %16 %16
 %_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
-         %22 = OpConstantNull %mat4v3float
-         %23 = OpTypeFunction %v4float
+         %20 = OpConstantNull %mat4v3float
+         %21 = OpTypeFunction %v4float
 %transpose_d8f8ba = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat4v3float Function %22
-         %13 = OpTranspose %mat4v3float %19
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat4v3float Function %20
+               OpStore %res %17
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %transpose_d8f8ba
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_d8f8ba
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_d8f8ba
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_d8f8ba
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_d8f8ba
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_d8f8ba
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/dc671a.wgsl b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl
new file mode 100644
index 0000000..7ce8237
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/dc671a.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 transpose(mat<4, 4, fa>) -> mat<4, 4, fa>
+fn transpose_dc671a() {
+  var res = transpose(mat4x4(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_dc671a();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_dc671a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_dc671a();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0d7ff26
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_dc671a() {
+  float4x4 res = float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_dc671a();
+  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() {
+  transpose_dc671a();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_dc671a();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0d7ff26
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_dc671a() {
+  float4x4 res = float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_dc671a();
+  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() {
+  transpose_dc671a();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_dc671a();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.glsl
new file mode 100644
index 0000000..7757e01
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_dc671a() {
+  mat4 res = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_dc671a();
+  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 transpose_dc671a() {
+  mat4 res = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
+}
+
+void fragment_main() {
+  transpose_dc671a();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_dc671a() {
+  mat4 res = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
+}
+
+void compute_main() {
+  transpose_dc671a();
+}
+
+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/transpose/dc671a.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.msl
new file mode 100644
index 0000000..7ed040d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_dc671a() {
+  float4x4 res = float4x4(float4(1.0f), float4(1.0f), float4(1.0f), float4(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_dc671a();
+  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() {
+  transpose_dc671a();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_dc671a();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.spvasm
new file mode 100644
index 0000000..f5c5b56
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; 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 %transpose_dc671a "transpose_dc671a"
+               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
+%mat4v4float = OpTypeMatrix %v4float 4
+    %float_1 = OpConstant %float 1
+         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %16 = OpConstantComposite %mat4v4float %15 %15 %15 %15
+%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
+         %19 = OpConstantNull %mat4v4float
+         %20 = OpTypeFunction %v4float
+%transpose_dc671a = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat4v4float Function %19
+               OpStore %res %16
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %transpose_dc671a
+               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
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %transpose_dc671a
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_dc671a
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.wgsl
new file mode 100644
index 0000000..f89b543
--- /dev/null
+++ b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn transpose_dc671a() {
+  var res = transpose(mat4x4(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_dc671a();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_dc671a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_dc671a();
+}
diff --git a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.dxc.hlsl
index 042c3b7..47e3175 100644
--- a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_ed4bdc() {
-  float2x3 res = transpose(float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx));
+  float2x3 res = float2x3((1.0f).xxx, (1.0f).xxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.fxc.hlsl
index 042c3b7..47e3175 100644
--- a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_ed4bdc() {
-  float2x3 res = transpose(float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx));
+  float2x3 res = float2x3((1.0f).xxx, (1.0f).xxx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.glsl
index 79cd1c3..3179df8 100644
--- a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void transpose_ed4bdc() {
-  mat2x3 res = transpose(mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f)));
+  mat2x3 res = mat2x3(vec3(1.0f), vec3(1.0f));
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void transpose_ed4bdc() {
-  mat2x3 res = transpose(mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f)));
+  mat2x3 res = mat2x3(vec3(1.0f), vec3(1.0f));
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void transpose_ed4bdc() {
-  mat2x3 res = transpose(mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f)));
+  mat2x3 res = mat2x3(vec3(1.0f), vec3(1.0f));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.msl
index 3f1013d..1f9c1a8 100644
--- a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_ed4bdc() {
-  float2x3 res = transpose(float3x2(float2(1.0f), float2(1.0f), float2(1.0f)));
+  float2x3 res = float2x3(float3(1.0f), float3(1.0f));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.spvasm
index 1812c0c..434bdee 100644
--- a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -32,40 +32,37 @@
           %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
 %mat2v3float = OpTypeMatrix %v3float 2
-    %v2float = OpTypeVector %float 2
-%mat3v2float = OpTypeMatrix %v2float 3
     %float_1 = OpConstant %float 1
-         %19 = OpConstantComposite %v2float %float_1 %float_1
-         %20 = OpConstantComposite %mat3v2float %19 %19 %19
+         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %mat2v3float %16 %16
 %_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
-         %23 = OpConstantNull %mat2v3float
-         %24 = OpTypeFunction %v4float
+         %20 = OpConstantNull %mat2v3float
+         %21 = OpTypeFunction %v4float
 %transpose_ed4bdc = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat2v3float Function %23
-         %13 = OpTranspose %mat2v3float %20
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat2v3float Function %20
+               OpStore %res %17
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %transpose_ed4bdc
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_ed4bdc
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_ed4bdc
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_ed4bdc
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %transpose_ed4bdc
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_ed4bdc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.dxc.hlsl
index 3b78a5a..9be9430 100644
--- a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void transpose_faeb05() {
-  matrix<float16_t, 4, 2> res = transpose(matrix<float16_t, 2, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx));
+  matrix<float16_t, 4, 2> res = matrix<float16_t, 4, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.glsl
index e382231..07ae2dd 100644
--- a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_faeb05() {
-  f16mat4x2 res = transpose(f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf)));
+  f16mat4x2 res = f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void transpose_faeb05() {
-  f16mat4x2 res = transpose(f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf)));
+  f16mat4x2 res = f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void transpose_faeb05() {
-  f16mat4x2 res = transpose(f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf)));
+  f16mat4x2 res = f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.msl
index e4e8470..845b1bc 100644
--- a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void transpose_faeb05() {
-  half4x2 res = transpose(half2x4(half4(1.0h), half4(1.0h)));
+  half4x2 res = half4x2(half2(1.0h), half2(1.0h), half2(1.0h), half2(1.0h));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.spvasm
index 50f0184..0d70272 100644
--- a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -37,41 +37,38 @@
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
  %mat4v2half = OpTypeMatrix %v2half 4
-     %v4half = OpTypeVector %half 4
- %mat2v4half = OpTypeMatrix %v4half 2
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %20 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %21 = OpConstantComposite %mat2v4half %20 %20
+         %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %18 = OpConstantComposite %mat4v2half %17 %17 %17 %17
 %_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
-         %24 = OpConstantNull %mat4v2half
-         %25 = OpTypeFunction %v4float
+         %21 = OpConstantNull %mat4v2half
+         %22 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %transpose_faeb05 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat4v2half Function %24
-         %13 = OpTranspose %mat4v2half %21
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_mat4v2half Function %21
+               OpStore %res %18
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %transpose_faeb05
+%vertex_main_inner = OpFunction %v4float None %22
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %transpose_faeb05
                OpReturnValue %5
                OpFunctionEnd
 %vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+         %27 = OpLabel
+         %28 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %28
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_faeb05
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_faeb05
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %transpose_faeb05
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %transpose_faeb05
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/32dd64.wgsl b/test/tint/builtins/gen/var/transpose/32dd64.wgsl
new file mode 100644
index 0000000..29621e6
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/32dd64.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 transpose(mat<3, 4, fa>) -> mat<4, 3, fa>
+fn transpose_32dd64() {
+  const arg_0 = mat3x4(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_32dd64();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_32dd64();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_32dd64();
+}
diff --git a/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..eb895be
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_32dd64() {
+  float4x3 res = float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_32dd64();
+  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() {
+  transpose_32dd64();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_32dd64();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..eb895be
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_32dd64() {
+  float4x3 res = float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_32dd64();
+  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() {
+  transpose_32dd64();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_32dd64();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.glsl
new file mode 100644
index 0000000..4fdd5cf
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_32dd64() {
+  mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_32dd64();
+  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 transpose_32dd64() {
+  mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
+}
+
+void fragment_main() {
+  transpose_32dd64();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_32dd64() {
+  mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
+}
+
+void compute_main() {
+  transpose_32dd64();
+}
+
+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/transpose/32dd64.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.msl
new file mode 100644
index 0000000..fa8254f
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_32dd64() {
+  float4x3 res = float4x3(float3(1.0f), float3(1.0f), float3(1.0f), float3(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_32dd64();
+  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() {
+  transpose_32dd64();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_32dd64();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.spvasm
new file mode 100644
index 0000000..0868d05
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/32dd64.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 %transpose_32dd64 "transpose_32dd64"
+               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
+%mat4v3float = OpTypeMatrix %v3float 4
+    %float_1 = OpConstant %float 1
+         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %mat4v3float %16 %16 %16 %16
+%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
+         %20 = OpConstantNull %mat4v3float
+         %21 = OpTypeFunction %v4float
+%transpose_32dd64 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat4v3float Function %20
+               OpStore %res %17
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_32dd64
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_32dd64
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_32dd64
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.wgsl
new file mode 100644
index 0000000..fd4b3a7
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/32dd64.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn transpose_32dd64() {
+  const arg_0 = mat3x4(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_32dd64();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_32dd64();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_32dd64();
+}
diff --git a/test/tint/builtins/gen/var/transpose/553e90.wgsl b/test/tint/builtins/gen/var/transpose/553e90.wgsl
new file mode 100644
index 0000000..dae39d4
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/553e90.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 transpose(mat<4, 2, fa>) -> mat<2, 4, fa>
+fn transpose_553e90() {
+  const arg_0 = mat4x2(1., 1., 1., 1., 1., 1., 1., 1.);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_553e90();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_553e90();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_553e90();
+}
diff --git a/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..eb7293b
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_553e90() {
+  float2x4 res = float2x4((1.0f).xxxx, (1.0f).xxxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_553e90();
+  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() {
+  transpose_553e90();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_553e90();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..eb7293b
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_553e90() {
+  float2x4 res = float2x4((1.0f).xxxx, (1.0f).xxxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_553e90();
+  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() {
+  transpose_553e90();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_553e90();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.glsl
new file mode 100644
index 0000000..8c4e25d
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_553e90() {
+  mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_553e90();
+  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 transpose_553e90() {
+  mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
+}
+
+void fragment_main() {
+  transpose_553e90();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_553e90() {
+  mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
+}
+
+void compute_main() {
+  transpose_553e90();
+}
+
+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/transpose/553e90.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.msl
new file mode 100644
index 0000000..16fe599
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_553e90() {
+  float2x4 res = float2x4(float4(1.0f), float4(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_553e90();
+  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() {
+  transpose_553e90();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_553e90();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.spvasm
new file mode 100644
index 0000000..0b258fe
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; 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 %transpose_553e90 "transpose_553e90"
+               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
+%mat2v4float = OpTypeMatrix %v4float 2
+    %float_1 = OpConstant %float 1
+         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %16 = OpConstantComposite %mat2v4float %15 %15
+%_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
+         %19 = OpConstantNull %mat2v4float
+         %20 = OpTypeFunction %v4float
+%transpose_553e90 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat2v4float Function %19
+               OpStore %res %16
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %transpose_553e90
+               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
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %transpose_553e90
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_553e90
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.wgsl
new file mode 100644
index 0000000..652ebab
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/553e90.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn transpose_553e90() {
+  const arg_0 = mat4x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_553e90();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_553e90();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_553e90();
+}
diff --git a/test/tint/builtins/gen/var/transpose/5c133c.wgsl b/test/tint/builtins/gen/var/transpose/5c133c.wgsl
new file mode 100644
index 0000000..b41c917
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/5c133c.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 transpose(mat<4, 3, fa>) -> mat<3, 4, fa>
+fn transpose_5c133c() {
+  const arg_0 = mat4x3(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_5c133c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_5c133c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_5c133c();
+}
diff --git a/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9db91a8
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_5c133c() {
+  float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_5c133c();
+  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() {
+  transpose_5c133c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_5c133c();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9db91a8
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_5c133c() {
+  float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_5c133c();
+  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() {
+  transpose_5c133c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_5c133c();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.glsl
new file mode 100644
index 0000000..1a04ea6
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_5c133c() {
+  mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_5c133c();
+  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 transpose_5c133c() {
+  mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
+}
+
+void fragment_main() {
+  transpose_5c133c();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_5c133c() {
+  mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
+}
+
+void compute_main() {
+  transpose_5c133c();
+}
+
+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/transpose/5c133c.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.msl
new file mode 100644
index 0000000..c8338d3
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_5c133c() {
+  float3x4 res = float3x4(float4(1.0f), float4(1.0f), float4(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_5c133c();
+  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() {
+  transpose_5c133c();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_5c133c();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.spvasm
new file mode 100644
index 0000000..a3908ba
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; 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 %transpose_5c133c "transpose_5c133c"
+               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
+%mat3v4float = OpTypeMatrix %v4float 3
+    %float_1 = OpConstant %float 1
+         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %16 = OpConstantComposite %mat3v4float %15 %15 %15
+%_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
+         %19 = OpConstantNull %mat3v4float
+         %20 = OpTypeFunction %v4float
+%transpose_5c133c = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat3v4float Function %19
+               OpStore %res %16
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %transpose_5c133c
+               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
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %transpose_5c133c
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_5c133c
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.wgsl
new file mode 100644
index 0000000..28ef1a9
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/5c133c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn transpose_5c133c() {
+  const arg_0 = mat4x3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_5c133c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_5c133c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_5c133c();
+}
diff --git a/test/tint/builtins/gen/var/transpose/66fce8.wgsl b/test/tint/builtins/gen/var/transpose/66fce8.wgsl
new file mode 100644
index 0000000..d5c553e
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/66fce8.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 transpose(mat<3, 3, fa>) -> mat<3, 3, fa>
+fn transpose_66fce8() {
+  const arg_0 = mat3x3(1., 1., 1., 1., 1., 1., 1., 1., 1.);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_66fce8();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_66fce8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_66fce8();
+}
diff --git a/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..604b6c5
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_66fce8() {
+  float3x3 res = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_66fce8();
+  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() {
+  transpose_66fce8();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_66fce8();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..604b6c5
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_66fce8() {
+  float3x3 res = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_66fce8();
+  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() {
+  transpose_66fce8();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_66fce8();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.glsl
new file mode 100644
index 0000000..7abc811
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_66fce8() {
+  mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_66fce8();
+  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 transpose_66fce8() {
+  mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
+}
+
+void fragment_main() {
+  transpose_66fce8();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_66fce8() {
+  mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
+}
+
+void compute_main() {
+  transpose_66fce8();
+}
+
+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/transpose/66fce8.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.msl
new file mode 100644
index 0000000..230466c
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_66fce8() {
+  float3x3 res = float3x3(float3(1.0f), float3(1.0f), float3(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_66fce8();
+  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() {
+  transpose_66fce8();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_66fce8();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.spvasm
new file mode 100644
index 0000000..2a807d4
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/66fce8.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 %transpose_66fce8 "transpose_66fce8"
+               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
+%mat3v3float = OpTypeMatrix %v3float 3
+    %float_1 = OpConstant %float 1
+         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %mat3v3float %16 %16 %16
+%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
+         %20 = OpConstantNull %mat3v3float
+         %21 = OpTypeFunction %v4float
+%transpose_66fce8 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat3v3float Function %20
+               OpStore %res %17
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_66fce8
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_66fce8
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_66fce8
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.wgsl
new file mode 100644
index 0000000..fae5be4
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/66fce8.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn transpose_66fce8() {
+  const arg_0 = mat3x3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_66fce8();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_66fce8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_66fce8();
+}
diff --git a/test/tint/builtins/gen/var/transpose/70ca11.wgsl b/test/tint/builtins/gen/var/transpose/70ca11.wgsl
new file mode 100644
index 0000000..00419e9
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/70ca11.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 transpose(mat<2, 3, fa>) -> mat<3, 2, fa>
+fn transpose_70ca11() {
+  const arg_0 = mat2x3(1., 1., 1., 1., 1., 1.);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_70ca11();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_70ca11();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_70ca11();
+}
diff --git a/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ce7b788
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_70ca11() {
+  float3x2 res = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_70ca11();
+  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() {
+  transpose_70ca11();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_70ca11();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ce7b788
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_70ca11() {
+  float3x2 res = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_70ca11();
+  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() {
+  transpose_70ca11();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_70ca11();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.glsl
new file mode 100644
index 0000000..5f8dd67
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_70ca11() {
+  mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_70ca11();
+  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 transpose_70ca11() {
+  mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
+}
+
+void fragment_main() {
+  transpose_70ca11();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_70ca11() {
+  mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
+}
+
+void compute_main() {
+  transpose_70ca11();
+}
+
+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/transpose/70ca11.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.msl
new file mode 100644
index 0000000..89a2e00
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_70ca11() {
+  float3x2 res = float3x2(float2(1.0f), float2(1.0f), float2(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_70ca11();
+  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() {
+  transpose_70ca11();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_70ca11();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.spvasm
new file mode 100644
index 0000000..346c295
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/70ca11.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 %transpose_70ca11 "transpose_70ca11"
+               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
+%mat3v2float = OpTypeMatrix %v2float 3
+    %float_1 = OpConstant %float 1
+         %16 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %mat3v2float %16 %16 %16
+%_ptr_Function_mat3v2float = OpTypePointer Function %mat3v2float
+         %20 = OpConstantNull %mat3v2float
+         %21 = OpTypeFunction %v4float
+%transpose_70ca11 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat3v2float Function %20
+               OpStore %res %17
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_70ca11
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_70ca11
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_70ca11
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.wgsl
new file mode 100644
index 0000000..55a2cf9
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/70ca11.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn transpose_70ca11() {
+  const arg_0 = mat2x3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_70ca11();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_70ca11();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_70ca11();
+}
diff --git a/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl
new file mode 100644
index 0000000..fbeee47
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/7eb2c5.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 transpose(mat<2, 2, fa>) -> mat<2, 2, fa>
+fn transpose_7eb2c5() {
+  const arg_0 = mat2x2(1., 1., 1., 1.);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_7eb2c5();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_7eb2c5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_7eb2c5();
+}
diff --git a/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f44fa67
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_7eb2c5() {
+  float2x2 res = float2x2((1.0f).xx, (1.0f).xx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_7eb2c5();
+  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() {
+  transpose_7eb2c5();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_7eb2c5();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f44fa67
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_7eb2c5() {
+  float2x2 res = float2x2((1.0f).xx, (1.0f).xx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_7eb2c5();
+  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() {
+  transpose_7eb2c5();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_7eb2c5();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.glsl
new file mode 100644
index 0000000..069cce3
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_7eb2c5() {
+  mat2 res = mat2(vec2(1.0f), vec2(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_7eb2c5();
+  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 transpose_7eb2c5() {
+  mat2 res = mat2(vec2(1.0f), vec2(1.0f));
+}
+
+void fragment_main() {
+  transpose_7eb2c5();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_7eb2c5() {
+  mat2 res = mat2(vec2(1.0f), vec2(1.0f));
+}
+
+void compute_main() {
+  transpose_7eb2c5();
+}
+
+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/transpose/7eb2c5.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.msl
new file mode 100644
index 0000000..857b8f5
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_7eb2c5() {
+  float2x2 res = float2x2(float2(1.0f), float2(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_7eb2c5();
+  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() {
+  transpose_7eb2c5();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_7eb2c5();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.spvasm
new file mode 100644
index 0000000..ab62733
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/7eb2c5.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 %transpose_7eb2c5 "transpose_7eb2c5"
+               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
+%mat2v2float = OpTypeMatrix %v2float 2
+    %float_1 = OpConstant %float 1
+         %16 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %mat2v2float %16 %16
+%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
+         %20 = OpConstantNull %mat2v2float
+         %21 = OpTypeFunction %v4float
+%transpose_7eb2c5 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat2v2float Function %20
+               OpStore %res %17
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_7eb2c5
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_7eb2c5
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_7eb2c5
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.wgsl
new file mode 100644
index 0000000..14eecb4
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn transpose_7eb2c5() {
+  const arg_0 = mat2x2(1.0, 1.0, 1.0, 1.0);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_7eb2c5();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_7eb2c5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_7eb2c5();
+}
diff --git a/test/tint/builtins/gen/var/transpose/84a763.wgsl b/test/tint/builtins/gen/var/transpose/84a763.wgsl
new file mode 100644
index 0000000..7e6263e
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/84a763.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 transpose(mat<2, 4, fa>) -> mat<4, 2, fa>
+fn transpose_84a763() {
+  const arg_0 = mat2x4(1., 1., 1., 1., 1., 1., 1., 1.);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_84a763();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_84a763();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_84a763();
+}
diff --git a/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..600c218
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_84a763() {
+  float4x2 res = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_84a763();
+  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() {
+  transpose_84a763();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_84a763();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..600c218
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_84a763() {
+  float4x2 res = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_84a763();
+  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() {
+  transpose_84a763();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_84a763();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.glsl
new file mode 100644
index 0000000..17c5103
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_84a763() {
+  mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_84a763();
+  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 transpose_84a763() {
+  mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
+}
+
+void fragment_main() {
+  transpose_84a763();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_84a763() {
+  mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
+}
+
+void compute_main() {
+  transpose_84a763();
+}
+
+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/transpose/84a763.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.msl
new file mode 100644
index 0000000..ae97507
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_84a763() {
+  float4x2 res = float4x2(float2(1.0f), float2(1.0f), float2(1.0f), float2(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_84a763();
+  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() {
+  transpose_84a763();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_84a763();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.spvasm
new file mode 100644
index 0000000..ee63dc0
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/84a763.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 %transpose_84a763 "transpose_84a763"
+               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
+%mat4v2float = OpTypeMatrix %v2float 4
+    %float_1 = OpConstant %float 1
+         %16 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %mat4v2float %16 %16 %16 %16
+%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
+         %20 = OpConstantNull %mat4v2float
+         %21 = OpTypeFunction %v4float
+%transpose_84a763 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat4v2float Function %20
+               OpStore %res %17
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_84a763
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_84a763
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_84a763
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.wgsl
new file mode 100644
index 0000000..eb5d5ff
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/84a763.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn transpose_84a763() {
+  const arg_0 = mat2x4(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_84a763();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_84a763();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_84a763();
+}
diff --git a/test/tint/builtins/gen/var/transpose/ace596.wgsl b/test/tint/builtins/gen/var/transpose/ace596.wgsl
new file mode 100644
index 0000000..f3e7c35
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/ace596.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 transpose(mat<3, 2, fa>) -> mat<2, 3, fa>
+fn transpose_ace596() {
+  const arg_0 = mat3x2(1., 1., 1., 1., 1., 1.);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_ace596();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_ace596();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_ace596();
+}
diff --git a/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5672d62
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_ace596() {
+  float2x3 res = float2x3((1.0f).xxx, (1.0f).xxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_ace596();
+  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() {
+  transpose_ace596();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_ace596();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5672d62
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_ace596() {
+  float2x3 res = float2x3((1.0f).xxx, (1.0f).xxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_ace596();
+  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() {
+  transpose_ace596();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_ace596();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.glsl
new file mode 100644
index 0000000..a3da82b
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_ace596() {
+  mat2x3 res = mat2x3(vec3(1.0f), vec3(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_ace596();
+  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 transpose_ace596() {
+  mat2x3 res = mat2x3(vec3(1.0f), vec3(1.0f));
+}
+
+void fragment_main() {
+  transpose_ace596();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_ace596() {
+  mat2x3 res = mat2x3(vec3(1.0f), vec3(1.0f));
+}
+
+void compute_main() {
+  transpose_ace596();
+}
+
+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/transpose/ace596.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.msl
new file mode 100644
index 0000000..6618a71
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_ace596() {
+  float2x3 res = float2x3(float3(1.0f), float3(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_ace596();
+  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() {
+  transpose_ace596();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_ace596();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.spvasm
new file mode 100644
index 0000000..0ce25bd
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/ace596.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 %transpose_ace596 "transpose_ace596"
+               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
+%mat2v3float = OpTypeMatrix %v3float 2
+    %float_1 = OpConstant %float 1
+         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %mat2v3float %16 %16
+%_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
+         %20 = OpConstantNull %mat2v3float
+         %21 = OpTypeFunction %v4float
+%transpose_ace596 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat2v3float Function %20
+               OpStore %res %17
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %21
+         %23 = OpLabel
+         %24 = OpFunctionCall %void %transpose_ace596
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %27
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %transpose_ace596
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_ace596
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.wgsl
new file mode 100644
index 0000000..ff63c60
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/ace596.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn transpose_ace596() {
+  const arg_0 = mat3x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.0);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_ace596();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_ace596();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_ace596();
+}
diff --git a/test/tint/builtins/gen/var/transpose/dc671a.wgsl b/test/tint/builtins/gen/var/transpose/dc671a.wgsl
new file mode 100644
index 0000000..feeed7d
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/dc671a.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 transpose(mat<4, 4, fa>) -> mat<4, 4, fa>
+fn transpose_dc671a() {
+  const arg_0 = mat4x4(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_dc671a();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_dc671a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_dc671a();
+}
diff --git a/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0d7ff26
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_dc671a() {
+  float4x4 res = float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_dc671a();
+  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() {
+  transpose_dc671a();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_dc671a();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0d7ff26
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void transpose_dc671a() {
+  float4x4 res = float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  transpose_dc671a();
+  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() {
+  transpose_dc671a();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  transpose_dc671a();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.glsl
new file mode 100644
index 0000000..7757e01
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void transpose_dc671a() {
+  mat4 res = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+  transpose_dc671a();
+  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 transpose_dc671a() {
+  mat4 res = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
+}
+
+void fragment_main() {
+  transpose_dc671a();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void transpose_dc671a() {
+  mat4 res = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
+}
+
+void compute_main() {
+  transpose_dc671a();
+}
+
+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/transpose/dc671a.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.msl
new file mode 100644
index 0000000..7ed040d
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void transpose_dc671a() {
+  float4x4 res = float4x4(float4(1.0f), float4(1.0f), float4(1.0f), float4(1.0f));
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  transpose_dc671a();
+  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() {
+  transpose_dc671a();
+  return;
+}
+
+kernel void compute_main() {
+  transpose_dc671a();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.spvasm
new file mode 100644
index 0000000..f5c5b56
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; 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 %transpose_dc671a "transpose_dc671a"
+               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
+%mat4v4float = OpTypeMatrix %v4float 4
+    %float_1 = OpConstant %float 1
+         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %16 = OpConstantComposite %mat4v4float %15 %15 %15 %15
+%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
+         %19 = OpConstantNull %mat4v4float
+         %20 = OpTypeFunction %v4float
+%transpose_dc671a = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_mat4v4float Function %19
+               OpStore %res %16
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %transpose_dc671a
+               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
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %transpose_dc671a
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_dc671a
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.wgsl
new file mode 100644
index 0000000..9594bc4
--- /dev/null
+++ b/test/tint/builtins/gen/var/transpose/dc671a.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn transpose_dc671a() {
+  const arg_0 = mat4x4(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0);
+  var res = transpose(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  transpose_dc671a();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  transpose_dc671a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  transpose_dc671a();
+}