[clang] [llvm] [SystemZ] Add support for __builtin_setjmp and __builtin_longjmp (PR #116642)

Ulrich Weigand via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 28 04:58:29 PST 2024


================
@@ -0,0 +1,24 @@
+;Test  longjmp load from jmp_buf.
+; Frame pointer from Slot 1.
+; Jump address from Slot 2.
+; Stack Pointer from Slot 4.
+; Literal Pool Pointer from Slot 5.
+
+; RUN: llc  < %s -mtriple=s390x-linux-gnu -O2 | FileCheck %s
+
+ at buf = dso_local global [20 x ptr] zeroinitializer, align 8
+
+; Function Attrs: noreturn nounwind
+define dso_local void @foo() local_unnamed_addr #0 {
+entry:
+; CHECK:        stmg    %r11, %r15, 88(%r15)
+; CHECK:        larl    %r1, buf
+; CHECK:        lg      %r2, 8(%r1)
+; CHECK:        lg      %r11, 0(%r1)
+; CHECK:        lg      %r13, 32(%r1)
+; CHECK:        lg      %r15, 24(%r1)
+; CHECK:        br      %r2
+
+  tail call void @llvm.eh.sjlj.longjmp(ptr nonnull @buf)
----------------
uweigand wrote:

Don't we need a declaration of that intrinsic somewhere in this file?

https://github.com/llvm/llvm-project/pull/116642


More information about the cfe-commits mailing list