xref: /llvm-project/llvm/test/CodeGen/X86/inline-asm-sp-clobber-memcpy.ll (revision 2f448bf509432c1a19ec46ab8cbc7353c03c6280)
1; RUN: llc < %s -stackrealign -mtriple i386-apple-darwin -mcpu=i486 | FileCheck %s
2
3%struct.foo = type { [88 x i8] }
4
5declare void @bar(ptr nocapture, ptr align 4 byval(%struct.foo)) nounwind
6
7; PR19012
8; Don't clobber %esi if we have inline asm that clobbers %esp.
9define void @test1(ptr nocapture %x, i32 %y, ptr %z) nounwind {
10  call void @bar(ptr %z, ptr align 4 byval(%struct.foo) %x)
11  call void asm sideeffect inteldialect "xor esp, esp", "=*m,~{flags},~{esp},~{esp},~{dirflag},~{fpsr},~{flags}"(ptr elementtype(i8) %z)
12  ret void
13
14; CHECK-LABEL: test1:
15; CHECK: movl %esp, %esi
16; CHECK-NOT: rep;movsl
17}
18