<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - llc assertion failure with COFF target"
   href="https://llvm.org/bugs/show_bug.cgi?id=25912">25912</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llc assertion failure with COFF target
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>davidxl@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>pass the following simple ll file to llc, llc will assert. I have not looked at
in in details.

; ModuleID = '<stdin>'
 target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-win64-coff"


@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void
()*, i8* } { i32 0, void ()* @__llvm_profile_init, i8* null }]

; Function Attrs: noinline
define internal void @__llvm_profile_init() unnamed_addr #1 {
  ret void
}

attributes #0 = { nounwind }


The assertion failure is:

llc: /usr/local/google/davidxl/dev/llvm/include/llvm/Support/Casting.h:237:
typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = llvm::MCSectionCOFF,
Y = llvm::MCSection]: Assertion `isa<X>(Val) && "cast<Ty>() argument of
incompatible type!"' failed.
0  llc             0x0000000000670b41 backtrace + 65
1  llc             0x0000000003ccd4c1
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 241
2  llc             0x0000000003cce9f4
3  libpthread.so.0 0x00007f379b9e3330
4  libc.so.6       0x00007f379ac0bcb7 gsignal + 55
5  libc.so.6       0x00007f379ac0f0a8 abort + 328
6  libc.so.6       0x00007f379ac04b76
7  libc.so.6       0x00007f379ac04c22
8  llc             0x0000000002cc7eb4
9  llc             0x0000000002634513
llvm::AsmPrinter::EmitXXStructorList(llvm::DataLayout const&, llvm::Constant
const*, bool) + 3523
10 llc             0x000000000261d26e
llvm::AsmPrinter::EmitSpecialLLVMGlobal(llvm::GlobalVariable const*) + 766</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>