1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/CodeGen/X86/speculative-load-hardening-no-spill.ll
Wang, Pengfei 70c7e49d44 [MS] Copy the symbols assigned to the former instruction when memory folding.
The memory folding raplaced the old instruction without copying the symbols assigned. Which will resulted in built fail due to the lost symbols.

Reviewed by craig.topper

Differential Revision: https://reviews.llvm.org/D78471
2020-06-10 15:38:32 +08:00

16 lines
591 B
LLVM

; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -x86-speculative-load-hardening | FileCheck %s
define i32 @foo(void ()** %0) {
; CHECK-LABEL: foo:
; CHECK: callq *(%{{.*}})
; CHECK-NEXT: .Lslh_ret_addr0:
; CHECK-NEXT: movq %rsp, %rcx
; CHECK-NEXT: movq -{{[0-9]+}}(%rsp), %rax
; CHECK-NEXT: sarq $63, %rcx
; CHECK-NEXT: cmpq $.Lslh_ret_addr0, %rax
%2 = load void ()*, void ()** %0
call void asm sideeffect "", "~{bx},~{cx},~{dx},~{bp},~{si},~{di},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"()
call void %2()
ret i32 0
}