[llvm] 9cb755c - [Test][JITLink] Save rbx in ExecutionEngine/JITLink/x86-64/ELF_vtune.s (#86472)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 15 16:37:39 PDT 2024


Author: Wu Yingcong
Date: 2024-04-15T17:37:35-06:00
New Revision: 9cb755cf5b2f48117fa34f257f386acf59ad6397

URL: https://github.com/llvm/llvm-project/commit/9cb755cf5b2f48117fa34f257f386acf59ad6397
DIFF: https://github.com/llvm/llvm-project/commit/9cb755cf5b2f48117fa34f257f386acf59ad6397.diff

LOG: [Test][JITLink] Save rbx in ExecutionEngine/JITLink/x86-64/ELF_vtune.s (#86472)

The callee should preserve rbx according to the calling convention, but
it is not in the test case `ExecutionEngine/JITLink/x86-64/ELF_vtune.s`.
Not preserving the rbx register may result in some random error to the
caller function. This patch adds the missing command to preserve the
rbx.

Added: 
    

Modified: 
    llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s

Removed: 
    


################################################################################
diff  --git a/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s b/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s
index 1c95bde51e1211..936486b8a319cc 100644
--- a/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s
+++ b/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_vtune.s
@@ -20,12 +20,14 @@ main:
         .cfi_def_cfa_offset 16
         .cfi_offset 6, -16
         movq    %rsp, %rbp
+        pushq   %rbx
         .cfi_def_cfa_register 6
-        movl    %edi, -4(%rbp)
-        movq    %rsi, -16(%rbp)
-        movl    -4(%rbp), %ebx
+        movl    %edi, -16(%rbp)
+        movq    %rsi, -24(%rbp)
+        movl    -16(%rbp), %ebx
         addl    $1, %ebx
-	movl   $0, %eax
+        movl    $0, %eax
+        popq    %rbx
         popq    %rbp
         .cfi_def_cfa 7, 8
         ret


        


More information about the llvm-commits mailing list