xref: /llvm-project/llvm/test/CodeGen/X86/speculative-load-hardening-no-spill.ll (revision 2f448bf509432c1a19ec46ab8cbc7353c03c6280)
1; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -x86-speculative-load-hardening | FileCheck %s
2
3define i32 @foo(ptr %0) {
4; CHECK-LABEL: foo:
5; CHECK:         callq *(%{{.*}})
6; CHECK-NEXT:  .Lslh_ret_addr0:
7; CHECK-NEXT:    movq %rsp, %rcx
8; CHECK-NEXT:    movq -{{[0-9]+}}(%rsp), %rax
9; CHECK-NEXT:    sarq $63, %rcx
10; CHECK-NEXT:    cmpq $.Lslh_ret_addr0, %rax
11  %2 = load ptr, ptr %0
12  call void asm sideeffect "", "~{bx},~{cx},~{dx},~{bp},~{si},~{di},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"()
13  call void %2()
14  ret i32 0
15}
16