[llvm] [Triple][M68k] Add missing handling for target m68k in getDefaultExceptionHandling. (PR #147492)

Jim Lin via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 02:25:14 PDT 2025


https://github.com/tclin914 created https://github.com/llvm/llvm-project/pull/147492

I encountered the assertion failure `Assertion TmpAsmInfo->getExceptionHandlingType() == getTargetTriple().getDefaultExceptionHandling() && "MCAsmInfo and Triple disagree on default exception handling type"' failed`.

>From 397f0247e8b03aecc9520d02a2618ba84ef750f1 Mon Sep 17 00:00:00 2001
From: Jim Lin <jim at andestech.com>
Date: Tue, 8 Jul 2025 15:19:32 +0800
Subject: [PATCH] [Triple][M68k] Add missing target m68k to
 getDefaultExceptionHandling.

I encountered the assertion failure `Assertion `TmpAsmInfo->getExceptionHandlingType() == getTargetTriple().getDefaultExceptionHandling() && "MCAsmInfo and Triple disagree on default exception handling type"' failed`.
---
 llvm/lib/TargetParser/Triple.cpp           | 1 +
 llvm/unittests/TargetParser/TripleTest.cpp | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp
index 45ef8c1329759..0584c941d2e6e 100644
--- a/llvm/lib/TargetParser/Triple.cpp
+++ b/llvm/lib/TargetParser/Triple.cpp
@@ -2288,6 +2288,7 @@ ExceptionHandling Triple::getDefaultExceptionHandling() const {
   case Triple::csky:
   case Triple::hexagon:
   case Triple::lanai:
+  case Triple::m68k:
   case Triple::msp430:
   case Triple::systemz:
   case Triple::xcore:
diff --git a/llvm/unittests/TargetParser/TripleTest.cpp b/llvm/unittests/TargetParser/TripleTest.cpp
index 7817e82322963..ca48e77cf7caa 100644
--- a/llvm/unittests/TargetParser/TripleTest.cpp
+++ b/llvm/unittests/TargetParser/TripleTest.cpp
@@ -2832,6 +2832,8 @@ TEST(TripleTest, DefaultExceptionHandling) {
       Triple("loongarch64-unknown-unknown").getDefaultExceptionHandling());
   EXPECT_EQ(ExceptionHandling::DwarfCFI,
             Triple("msp430-unknown-unknown").getDefaultExceptionHandling());
+  EXPECT_EQ(ExceptionHandling::DwarfCFI,
+            Triple("m68k-unknown-unknown").getDefaultExceptionHandling());
   EXPECT_EQ(ExceptionHandling::DwarfCFI,
             Triple("csky-unknown-unknown").getDefaultExceptionHandling());
 



More information about the llvm-commits mailing list