<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Metal Crash"
   href="https://bugs.llvm.org/show_bug.cgi?id=42028">42028</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Metal Crash
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>fanwj@mail.ustc.edu.cn
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22020" name="attach_22020" title="Crash backtrace">attachment 22020</a> <a href="attachment.cgi?id=22020&action=edit" title="Crash backtrace">[details]</a></span>
Crash backtrace

Compile the Code and metal compiler crash

#include <metal_stdlib>
using namespace metal;

struct VertexOutput
{
    float4 gl_Position [[position]];
};

struct VertexContext
{
    constant float4x4& projection;
    constant float3& position;
    union
    {
        VertexOutput out;
        struct
        {
            float4 gl_Position;
        };
    };

    VertexOutput main()
    {
        out.gl_Position = float4(position, 1.0);
        return out;
    }
};

vertex VertexOutput vertexShader(constant float4x4& projection [[buffer(0)]],
                                 constant float3& position [[buffer(1)]])
{
    auto b = VertexContext
    {
        .position = position,
        .projection = projection,
    }.main();
    VertexOutput d = b;
    return d;
}</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>