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