<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 - WebAssembly- assertion failure with alias for function"
   href="https://bugs.llvm.org/show_bug.cgi?id=38866">38866</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>WebAssembly- assertion failure with alias for function
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>llc
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dfordivam@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The alias in following code causes the below mentioned assertion with
webassembly target. It works fine with x86.

I guess this is because the alias Symbol is marked as 'isData' instead of
'isFunction'


llc: /home/divam/repos/llvm/lib/MC/WasmObjectWriter.cpp:1323: virtual uint64_t
{anonymous}::WasmObjectWriter::writeObject(llvm::MCAssembler&, const
llvm::MCAsmLayout&): Assertion `DataLocations.count(ResolvedSym) > 0' failed.

target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown-wasm"
; target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
; target triple = "i386-unknown-linux-gnu"
@ghczmprim_GHCziTypes_heqzusel_entry = alias i8, bitcast (void ()*
@ghczmprim_GHCziTypes_heqzusel_entry$def to i8*)
define ccc void @ghczmprim_GHCziTypes_heqzusel_entry$def() align 4 nounwind
{
c9YQ:
  %ln9YZ = ptrtoint i8* @MainCapability to i32
  %ln9Z0 = add i32 %ln9YZ, 808
  ret void
}
@MainCapability = external global i8</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>