<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65930>65930</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed. in compiling to wasm
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
doit-man
</td>
</tr>
</table>
<pre>
An error occurs when compiling the below file to the wasm.
```llvm/test/Transforms/SimplifyCFG/Hexagon/disable-lookup-table.ll```
With compile option:
```
llc --march=wasm32 -filetype=obj llvm/test/Transforms/SimplifyCFG/Hexagon/disable-lookup-table.ll -o disable-lookup-table.o
```
Stack:
```
llc: /llvm-project/llvm/include/llvm/Support/Casting.h:578: decltype(auto) llvm::cast(From *) [To = llvm::MCSymbolWasm, From = llvm::MCSymbol]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: build/bin/llc --march=wasm32 -filetype=obj llvm/test/Transforms/SimplifyCFG/Hexagon/disable-lookup-table.ll -o disable-lookup-table.o
#0 0x00007f555f3679e7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/doitman/llvm-optimization/jstv-experiment/Alive2/llvm-project/build/bin/../lib/libLLVMSupport.so.17git+0x1b89e7)
#1 0x00007f555f36554e llvm::sys::RunSignalHandlers() (/home/doitman/llvm-optimization/jstv-experiment/Alive2/llvm-project/build/bin/../lib/libLLVMSupport.so.17git+0x1b654e)
#2 0x00007f555f36807a SignalHandler(int) Signals.cpp:0:0
#3 0x00007f555ec8a520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007f555ecdea7c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x96a7c)
#5 0x00007f555ec8a476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007f555ec707f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x00007f555ec7071b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x00007f555ec81e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x00007f555fa9e6c7 llvm::MCContext::getWasmSection(llvm::Twine const&, llvm::SectionKind, unsigned int, llvm::MCSymbolWasm const*, unsigned int, char const*) (/home/doitman/llvm-optimization/jstv-experiment/Alive2/llvm-project/build/bin/../lib/libLLVMMC.so.17git+0x6a6c7)
#10 0x00007f555fa9e2ec llvm::MCContext::getWasmSection(llvm::Twine const&, llvm::SectionKind, unsigned int, llvm::Twine const&, unsigned int, char const*) (/home/doitman/llvm-optimization/jstv-experiment/Alive2/llvm-project/build/bin/../lib/libLLVMMC.so.17git+0x6a2ec)
#11 0x00007f556121cb9d llvm::TargetLoweringObjectFileWasm::InitializeWasm() (/home/doitman/llvm-optimization/jstv-experiment/Alive2/llvm-project/build/bin/../lib/libLLVMCodeGen.so.17git+0x6a6b9d)
#12 0x000000000040f394 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#13 0x000000000040cf9d main (build/bin/llc+0x40cf9d)
#14 0x00007f555ec71d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#15 0x00007f555ec71e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#16 0x000000000040a655 _start (build/bin/llc+0x40a655)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUV99v2zYQ_mvoF8ICRerngx9cp2qHJVixBO1jQFEnmQ1FGiTVOP3rB0pObDlZAQ_D2gWJEYnn777v7nhHcudkpwFWKH2H0qsFH_zW2FVjpF_2XC9q0zyt1hqDtcZiI8RgHX7cgsbC9DuppO6w3wKuQZlH3EoF2JvxzSN3fYTIFSJrlJHpV6lvPaKVB-cRre4s1641tneIVrey3ynZPm2qD4hWH2HPO6MR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