mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-22 07:32:48 +00:00
eba0a96f8e
Summary: [asan-asm-instrumentation] Fixed memory references which includes %rsp as a base or an index register. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5599 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219602 91177308-0d34-0410-b5e6-96231b3b80d8
46 lines
1.1 KiB
ArmAsm
46 lines
1.1 KiB
ArmAsm
# The test verifies that memory references through %rsp are correctly
|
|
# adjusted after instrumentation.
|
|
|
|
# RUN: llvm-mc %s -triple=x86_64-unknown-linux-gnu -asm-instrumentation=address -asan-instrument-assembly | FileCheck %s
|
|
|
|
# CHECK-LABEL: rsp_access
|
|
# CHECK: leaq -128(%rsp), %rsp
|
|
# CHECK: pushq %rax
|
|
# CHECK: pushq %rdi
|
|
# CHECK: pushfq
|
|
# CHECK: leaq 160(%rsp), %rdi
|
|
# CHECK: callq __asan_report_load8@PLT
|
|
# CHECK: popfq
|
|
# CHECK: popq %rdi
|
|
# CHECK: popq %rax
|
|
# CHECK: leaq 128(%rsp), %rsp
|
|
# CHECK: movq 8(%rsp), %rax
|
|
# CHECK: retq
|
|
|
|
.text
|
|
.globl rsp_access
|
|
.type rsp_access,@function
|
|
rsp_access:
|
|
movq 8(%rsp), %rax
|
|
retq
|
|
|
|
# CHECK-LABEL: rsp_32bit_access
|
|
# CHECK: leaq -128(%rsp), %rsp
|
|
# CHECK: pushq %rax
|
|
# CHECK: pushq %rdi
|
|
# CHECK: pushfq
|
|
# CHECK: leaq 2147483647(%rsp), %rdi
|
|
# CHECK: leaq 145(%rdi), %rdi
|
|
# CHECK: callq __asan_report_load8@PLT
|
|
# CHECK: popfq
|
|
# CHECK: popq %rdi
|
|
# CHECK: popq %rax
|
|
# CHECK: leaq 128(%rsp), %rsp
|
|
# CHECK: movq 2147483640(%rsp), %rax
|
|
# CHECK: retq
|
|
.globl rsp_32bit_access
|
|
.type rsp_32bit_access,@function
|
|
rsp_32bit_access:
|
|
movq 2147483640(%rsp), %rax
|
|
retq
|