Skip to content

Commit

Permalink
[x86/SLH][NFC] Add a test to produce a failed generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebewang committed May 12, 2020
1 parent 40f56c8 commit 2e9f115
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions llvm/test/CodeGen/X86/speculative-load-hardening-no-spill.ll
@@ -0,0 +1,15 @@
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -x86-speculative-load-hardening | FileCheck %s

define i32 @foo(void ()** %0) {
; CHECK-LABEL: foo:
; CHECK-NOT: .Lslh_ret_addr0:
; CHECK: callq *(%{{.*}})
; 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
}

0 comments on commit 2e9f115

Please sign in to comment.