<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63521>63521</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            `clangtk`: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          wierton
      </td>
    </tr>
</table>

<pre>
    The program which triggers assertion failure:
```
void f(float a) { asm("" : "=@ccc"(a)); }
```

Verification link https://gcc.godbolt.org/z/o3M9bsjK6
The output of `clangtk`:
```
clang: /root/llvm-project/llvm/include/llvm/Support/Casting.h:578: decltype(auto) llvm::cast(From*) [with To = llvm::IntegerType; From = llvm::Type]: 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, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang -gdwarf-4 -g -o /app/output.s -S --gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0 -fcolor-diagnostics -fno-crash-diagnostics <source>
1.      <eof> parser at end of file
2.      <source>:1:6: LLVM IR generation of declaration 'f'
3.      <source>:1:6: Generating code for declaration 'f'
 #0 0x00005572458a693f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c5293f)
 #1 0x00005572458a46ac llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c506ac)
 #2 0x00005572457eed98 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f6e4dc63420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007f6e4d73000b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
 #5 0x00007f6e4d70f859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #6 0x00007f6e4d70f729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
 #7 0x00007f6e4d720fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #8 0x00005572451145da llvm::ConstantInt::get(llvm::Type*, unsigned long, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x34c05da)
 #9 0x0000557245bbeb5d EmitAsmStores(clang::CodeGen::CodeGenFunction&, clang::AsmStmt const&, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::Type*>, llvm::ArrayRef<llvm::Type*>, llvm::ArrayRef<clang::CodeGen::LValue>, llvm::ArrayRef<clang::QualType>, llvm::BitVector const&, llvm::BitVector const&) CGStmt.cpp:0:0
#10 0x0000557245bcc932 clang::CodeGen::CodeGenFunction::EmitAsmStmt(clang::AsmStmt const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3f78932)
#11 0x0000557245bcf29b clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3f7b29b)
#12 0x0000557245bd5a04 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3f81a04)
#13 0x0000557245c3599a clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3fe199a)
#14 0x0000557245c495cf clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3ff55cf)
#15 0x0000557245cae539 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x405a539)
#16 0x0000557245ca94e5 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x40554e5)
#17 0x0000557245caa0b8 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x40560b8)
#18 0x0000557245cb2f03 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0) CodeGenModule.cpp:0:0
#19 0x0000557246b1ffe6 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ModuleBuilder.cpp:0:0
#20 0x0000557246b12090 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4ebe090)
#21 0x00005572480184b4 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63c44b4)
#22 0x0000557246b1cec8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4ec8ec8)
#23 0x0000557246367799 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4713799)
#24 0x00005572462ed0e6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x46990e6)
#25 0x000055724644beb6 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47f7eb6)
#26 0x0000557242d4a02d cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10f602d)
#27 0x0000557242d45d2a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#28 0x000055724614d7ed void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#29 0x00005572457ef2a0 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3b9b2a0)
#30 0x000055724614de0f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#31 0x0000557246114f7c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44c0f7c)
#32 0x0000557246115a0d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44c1a0d)
#33 0x000055724611daed clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44c9aed)
#34 0x0000557242d4828a clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10f428a)
#35 0x0000557242c4e5a5 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xffa5a5)
#36 0x00007f6e4d711083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#37 0x0000557242d40b0e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10ecb0e)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWt1u2zoSfhrmhrBBkfq9yIXj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