[compiler-rt] [JITLink] Allocate frames in SystemZ atexit tests (PR #215482)

Ilya Leoshkevich via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 00:23:01 PDT 2026


https://github.com/iii-i created https://github.com/llvm/llvm-project/pull/215482

SystemZ JITLink atexit tests crash, because they call functions without first allocating a frame.

Fix by allocating one. While at it, switch to the more conventional slots for %r14 and %r15.

>From 8bafb9ee088ef84858c81b8b5ec9b3fe3c6319a6 Mon Sep 17 00:00:00 2001
From: Ilya Leoshkevich <iii at linux.ibm.com>
Date: Sun, 9 Aug 2026 19:07:10 +0200
Subject: [PATCH] [JITLink] Allocate frames in SystemZ atexit tests

SystemZ JITLink atexit tests crash, because they call functions
without first allocating a frame.

Fix by allocating one. While at it, switch to the more conventional
slots for %r14 and %r15.
---
 .../test/orc/TestCases/Linux/systemz/trivial-atexit.S        | 5 +++--
 .../test/orc/TestCases/Linux/systemz/trivial-cxa-atexit.S    | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/compiler-rt/test/orc/TestCases/Linux/systemz/trivial-atexit.S b/compiler-rt/test/orc/TestCases/Linux/systemz/trivial-atexit.S
index 36b357501aede..8641d03e95395 100644
--- a/compiler-rt/test/orc/TestCases/Linux/systemz/trivial-atexit.S
+++ b/compiler-rt/test/orc/TestCases/Linux/systemz/trivial-atexit.S
@@ -25,13 +25,14 @@ _ZN6OnExitD2Ev:
 main:
         .cfi_startproc
 # %bb.0:
-        stmg    %r14, %r15, 48(%r15)
+        stmg    %r14, %r15, 112(%r15)
+        aghi    %r15, -160
         lgrl    %r2, _ZN6OnExitD2Ev at GOT
         brasl   %r14, atexit at PLT
         lghi    %r2, 1
         brasl   %r14, llvm_jitlink_setTestResultOverride at PLT
         lghi    %r2, 0
-        lmg     %r14, %r15, 48(%r15)
+        lmg     %r14, %r15, 272(%r15)
         br      %r14
 .Lfunc_end1:
         .size   main, .Lfunc_end1-main
diff --git a/compiler-rt/test/orc/TestCases/Linux/systemz/trivial-cxa-atexit.S b/compiler-rt/test/orc/TestCases/Linux/systemz/trivial-cxa-atexit.S
index e5d5191b088fb..02ffd5ef55133 100644
--- a/compiler-rt/test/orc/TestCases/Linux/systemz/trivial-cxa-atexit.S
+++ b/compiler-rt/test/orc/TestCases/Linux/systemz/trivial-cxa-atexit.S
@@ -21,7 +21,8 @@ _ZN6OnExitD2Ev:
 main:
         .cfi_startproc
 # %bb.0:
-        stmg    %r14, %r15, 48(%r15)
+        stmg    %r14, %r15, 112(%r15)
+        aghi    %r15, -160
         lgrl    %r2, _ZN6OnExitD2Ev at GOT
         lgrl    %r4, __dso_handle at GOT
         larl    %r3, _ZL6onExit
@@ -29,7 +30,7 @@ main:
         lghi    %r2, 1
         brasl   %r14, llvm_jitlink_setTestResultOverride at PLT
         lghi    %r2, 0
-        lmg     %r14, %r15, 48(%r15)
+        lmg     %r14, %r15, 272(%r15)
         br      %r14
 .Lfunc_end1:
         .size   main, .Lfunc_end1-main



More information about the llvm-commits mailing list