1; RUN: llc -mtriple=i386-apple-darwin -mcpu=yonah < %s | FileCheck %s
2
3declare void @llvm.memset.i32(i8*, i8, i32, i32) nounwind
4
5define fastcc void @t1() nounwind {
6entry:
7; CHECK-LABEL: t1:
8; CHECK: calll L_memset$stub
9  call void @llvm.memset.p0i8.i32(i8* null, i8 0, i32 188, i32 1, i1 false)
10  unreachable
11}
12
13define fastcc void @t2(i8 signext %c) nounwind {
14entry:
15; CHECK-LABEL: t2:
16; CHECK: calll L_memset$stub
17  call void @llvm.memset.p0i8.i32(i8* undef, i8 %c, i32 76, i32 1, i1 false)
18  unreachable
19}
20
21declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
22
23define void @t3(i8* nocapture %s, i8 %a) nounwind {
24entry:
25  tail call void @llvm.memset.p0i8.i32(i8* %s, i8 %a, i32 8, i32 1, i1 false)
26  ret void
27; CHECK-LABEL: t3:
28; CHECK: imull $16843009
29}
30
31define void @t4(i8* nocapture %s, i8 %a) nounwind {
32entry:
33  tail call void @llvm.memset.p0i8.i32(i8* %s, i8 %a, i32 15, i32 1, i1 false)
34  ret void
35; CHECK-LABEL: t4:
36; CHECK: imull $16843009
37; CHECK-NOT: imul
38; CHECK: ret
39}
40