1 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
2 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
3 target triple = "i686-pc-windows-msvc18.0.0"
5 %struct.T = type { i64, [3 x i32] }
7 ; Function Attrs: nounwind optsize
8 define void @f(i8* %p, i8* %q, i32* inalloca nocapture %unused) #0 {
10 %g = alloca %struct.T, align 8
11 %r = alloca i32, align 8
12 store i32 0, i32* %r, align 4
13 call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %p, i8* align 8 %q, i32 24, i1 false)
16 while.body: ; preds = %while.body, %entry
17 %load = load i32, i32* %r, align 4
18 %dec = add nsw i32 %load, -1
19 store i32 %dec, i32* %r, align 4
20 call void @g(%struct.T* %g)
21 %tobool = icmp eq i32 %dec, 0
22 br i1 %tobool, label %while.end, label %while.body
24 while.end: ; preds = %while.body
28 ; Function Attrs: argmemonly nounwind
29 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1) #1
31 declare void @g(%struct.T*)
35 ; CHECK: movl %esp, %ebp
36 ; CHECK: andl $-8, %esp
37 ; CHECK-NOT: movl %esp, %esi
39 ; CHECK: leal 8(%esp), %esi
42 ; CHECK: setne %[[NE_REG:.*]]
45 ; CHECK: addl $4, %esp
46 ; CHECK: testb %[[NE_REG]], %[[NE_REG]]
49 attributes #0 = { nounwind optsize }
50 attributes #1 = { argmemonly nounwind }