[clang] [Clang][LoongArch] Add support for UEFI target (PR #155598)
Lu Weining via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 27 20:18:39 PDT 2025
================
@@ -594,6 +594,19 @@ TEST(ToolChainTest, UEFICallingConventionTest) {
EXPECT_EQ(compiler.getTarget().getCallingConvKind(true),
TargetInfo::CallingConvKind::CCK_MicrosoftWin64);
+
+ TrStr = "loongarch64-unknown-uefi";
+ Tr.setOS(llvm::Triple::OSType::UEFI);
+ Tr.setVendor(llvm::Triple::VendorType::UnknownVendor);
+ Tr.setEnvironment(llvm::Triple::EnvironmentType::UnknownEnvironment);
+ Tr.setArch(llvm::Triple::ArchType::loongarch64);
+
+ compiler.getTargetOpts().Triple = Tr.getTriple();
+ compiler.setTarget(clang::TargetInfo::CreateTargetInfo(
+ compiler.getDiagnostics(), compiler.getTargetOpts()));
+
+ EXPECT_EQ(compiler.getTarget().getCallingConvKind(true),
+ TargetInfo::CallingConvKind::CCK_Default);
----------------
SixWeining wrote:
No need to add this test until you override the `getCallingConvKind` interface in `Basic/Targets/X86.h`.
https://github.com/llvm/llvm-project/pull/155598
More information about the cfe-commits
mailing list