[llvm] [CodeGen] Diagnose unsupported landingpad result types instead of asserting (PR #223205)
Oliver Hunt via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 13 00:50:44 PDT 2026
================
@@ -0,0 +1,46 @@
+; RUN: not llc %s -mtriple=x86_64-unknown-linux-gnu -filetype=null 2>&1 | FileCheck %s
+; RUN: not llc %s -mtriple=x86_64-unknown-linux-gnu -O0 -filetype=null 2>&1 | FileCheck %s
+
+; A landingpad whose result type is not (exception pointer, selector) used to
+; trip an assertion in SelectionDAGBuilder::visitLandingPad. Expect a clean
+; diagnostic instead.
+
+; CHECK: error: {{.*}}in function main{{.*}}landingpad result type must consist of exactly two values, the exception pointer and the selector
+define i32 @main() personality ptr @__gxx_personality_v0 {
+ invoke void @g()
+ to label %cont unwind label %cleanup
+cont:
+ ret i32 0
+cleanup:
+ %lp = landingpad {}
----------------
ojhunt wrote:
yeah, consider `%lp = landingpad {float, i32}` - I think that will also go wrong despite matching element count
https://github.com/llvm/llvm-project/pull/223205
More information about the llvm-commits
mailing list