42 lines · plain
1; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X862; RUN: llc < %s -mtriple=i686-w64-windows-gnu | FileCheck %s -check-prefix=X863; Control Flow Guard is currently only available on Windows4 5%struct.HVA = type { double, double, double, double }6 7; Test that Control Flow Guard checks are correctly added for x86 vector calls.8define void @func_cf_vector_x86(ptr %0, ptr %1) #0 {9entry:10 %2 = alloca %struct.HVA, align 811 call void @llvm.memcpy.p0.p0.i32(ptr align 8 %2, ptr align 8 %1, i32 32, i1 false)12 %3 = load %struct.HVA, ptr %2, align 813 call x86_vectorcallcc void %0(%struct.HVA inreg %3)14 ret void15 16 ; X86-LABEL: func_cf_vector_x8617 ; X86: movl 12(%ebp), %eax18 ; X86: movl 8(%ebp), %ecx19 ; X86: movsd 24(%eax), %xmm4 # xmm4 = mem[0],zero20 ; X86: movsd %xmm4, 24(%esp)21 ; X86: movsd 16(%eax), %xmm5 # xmm5 = mem[0],zero22 ; X86: movsd %xmm5, 16(%esp)23 ; X86: movsd (%eax), %xmm6 # xmm6 = mem[0],zero24 ; X86: movsd 8(%eax), %xmm7 # xmm7 = mem[0],zero25 ; X86: movsd %xmm7, 8(%esp)26 ; X86: movsd %xmm6, (%esp)27 ; X86: calll *___guard_check_icall_fptr28 ; X86: movaps %xmm6, %xmm029 ; X86: movaps %xmm7, %xmm130 ; X86: movaps %xmm5, %xmm231 ; X86: movaps %xmm4, %xmm332 ; X86: calll *%ecx33}34attributes #0 = { "target-cpu"="pentium4" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" }35 36declare void @llvm.memcpy.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #137attributes #1 = { argmemonly nounwind willreturn }38 39 40!llvm.module.flags = !{!0}41!0 = !{i32 2, !"cfguard", i32 2}42