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

    <tr>
        <th>Summary</th>
        <td>
            [clang] Assertion `S.getASTContext().getTargetInfo().getTriple().isAArch64()' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            regression,
            crash-on-valid,
            clang:frontend:fuzzer
      </td>
    </tr>

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

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

<pre>
    **This testcase is generated by a fuzzer.**

Compiler Explorer: [https://godbolt.org/z/88vY5nrdK](https://godbolt.org/z/88vY5nrdK)

This valid code will crash on Clang Assertion Trunk.
```cpp
__attribute__((target_version("aes"))) 
void f() {}
```

It seems that this is valid for clang-19.

Stack dump:
```
clang++: /root/llvm-project/clang/lib/Sema/SemaDecl.cpp:11069: bool CheckMultiVersionValue(clang::Sema&, const clang::FunctionDecl*): Assertion `S.getASTContext().getTargetInfo().getTriple().isAArch64()' 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 -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics <source>
1.      <source>:2:10: current parser token '{'
 #0 0x0000000003be9e28 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3be9e28)
 #1 0x0000000003be7b2c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3be7b2c)
 #2 0x0000000003b35468 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x0000749ed2042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x0000749ed20969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x0000749ed2042476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x0000749ed20287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x0000749ed202871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x0000749ed2039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x0000000006a69e24 CheckMultiVersionValue(clang::Sema&, clang::FunctionDecl const*) SemaDecl.cpp:0:0
#10 0x0000000006ab1d64 CheckMultiVersionFunction(clang::Sema&, clang::FunctionDecl*, bool&, clang::NamedDecl*&, clang::LookupResult&) SemaDecl.cpp:0:0
#11 0x0000000006ab3bc6 clang::Sema::CheckFunctionDeclaration(clang::Scope*, clang::FunctionDecl*, clang::LookupResult&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ab3bc6)
#12 0x0000000006aba136 clang::Sema::ActOnFunctionDeclarator(clang::Scope*, clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*, clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>, bool&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6aba136)
#13 0x0000000006abf390 clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6abf390)
#14 0x0000000006abfd40 clang::Sema::ActOnStartOfFunctionDef(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>, clang::SkipBodyInfo*, clang::Sema::FnBodyKind) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6abfd40)
#15 0x00000000066f5300 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66f5300)
#16 0x000000000672a2bd clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x672a2bd)
#17 0x00000000066e98fe clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66e98fe)
#18 0x00000000066ea0be clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66ea0be)
#19 0x00000000066f1853 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66f1853)
#20 0x00000000066f273d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66f273d)
#21 0x00000000066f2be0 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66f2be0)
#22 0x00000000066e4c22 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66e4c22)
#23 0x0000000004563b58 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4563b58)
#24 0x000000000481e689 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x481e689)
#25 0x000000000479d8fe clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x479d8fe)
#26 0x000000000490441e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x490441e)
#27 0x0000000000ce624f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xce624f)
#28 0x0000000000cddf0a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#29 0x00000000045a6cb9 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
#30 0x0000000003b35914 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3b35914)
#31 0x00000000045a72af 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
#32 0x000000000456d63d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x456d63d)
#33 0x000000000456e72d 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+++0x456e72d)
#34 0x0000000004575ae5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4575ae5)
#35 0x0000000000ce30e9 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xce30e9)
#36 0x0000000000bb0284 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xbb0284)
#37 0x0000749ed2029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#38 0x0000749ed2029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#39 0x0000000000cdd9be _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcdd9be)
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/eJzkml9z4jgSwD-N86IyZct_sB_ywJCwl93szdSQ2qp7omS5DdoYySfJDJlPfyXZEMsBZnIX9qruttgJyFKr-9etVtsWUYqtOcCtl3zykrsb0uqNkLcv7E_C4yxObgpRvtx6eObh2dOGKaRBaUoUIKbQGjhIoqFExQsiqGq_fwc56Tp7wZ0X9P_OxbZhNUh0v29qIUF60Qx5yaeN1o3yopmHFx5erEVZiFpPhFx7ePHdw4ss2_0j4bL8zUvuPJz9fHecD6e3eu9IzUpERQnoG6trRCVRGyQ4mteEr9FMKZCaCY6eZMufJ_34NOg-tGm6ltWKaC1Z0WpYrTyceTjTRK5Br3YgFRPctmECysPY6GE_qBu8E6xEle2RI2_6yZvejeYZqv2gkQLYKqQ3RCNtjDjaUQmJqFHcD_PJcNBSE_qMynbbGFCnhNthHv5kPsYNeCGF0B5e1PVu6zdS_AnU_Oz7LWpWeHixhC3p_9wBrScGSDQLwyDNjZRCiBrNN0Cff29rzf7oWPxB6hY8nHWiopkXzTo5qYfniAquNBpcW7ScGheYCWwQWdGvnvHSYDlZg54tn-aCa9jrDqVpe7JOeOCVGLRJ1tTQ_2ZqNpN0k8bdbw9PUUVYDWWP78vj_Wx5j1RbbJlGBBXtGklohNRICzQKPaY3bTGhYttje0uPKdWaGFggwkvEOK3bEpDeQB94BaHPWhIKhkQjoZG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