1; RUN: llc < %s -O0 -fast-isel-abort=1 -march=x86 -mtriple=i686-apple-darwin8 2>/dev/null | FileCheck %s 2; RUN: llc < %s -O0 -fast-isel-abort=1 -march=x86 -mtriple=i686-apple-darwin8 2>&1 >/dev/null | FileCheck -check-prefix=STDERR -allow-empty %s 3 4%struct.s = type {i32, i32, i32} 5 6define i32 @test1() nounwind { 7tak: 8 %tmp = call i1 @foo() 9 br i1 %tmp, label %BB1, label %BB2 10BB1: 11 ret i32 1 12BB2: 13 ret i32 0 14; CHECK-LABEL: test1: 15; CHECK: calll 16; CHECK-NEXT: testb $1 17} 18declare zeroext i1 @foo() nounwind 19 20declare void @foo2(%struct.s* byval) 21 22define void @test2(%struct.s* %d) nounwind { 23 call void @foo2(%struct.s* byval %d ) 24 ret void 25; CHECK-LABEL: test2: 26; CHECK: movl (%eax), %ecx 27; CHECK: movl %ecx, (%esp) 28; CHECK: movl 4(%eax), %ecx 29; CHECK: movl %ecx, 4(%esp) 30; CHECK: movl 8(%eax), %eax 31; CHECK: movl %eax, 8(%esp) 32} 33 34declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind 35 36define void @test3(i8* %a) { 37 call void @llvm.memset.p0i8.i32(i8* %a, i8 0, i32 100, i32 1, i1 false) 38 ret void 39; CHECK-LABEL: test3: 40; CHECK: movl {{.*}}, (%esp) 41; CHECK: movl $0, 4(%esp) 42; CHECK: movl $100, 8(%esp) 43; CHECK: calll {{.*}}memset 44} 45 46declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind 47 48define void @test4(i8* %a, i8* %b) { 49 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %b, i32 100, i32 1, i1 false) 50 ret void 51; CHECK-LABEL: test4: 52; CHECK: movl {{.*}}, (%esp) 53; CHECK: movl {{.*}}, 4(%esp) 54; CHECK: movl $100, 8(%esp) 55; CHECK: calll {{.*}}memcpy 56} 57 58; STDERR-NOT: FastISel missed call: call x86_thiscallcc void @thiscallfun 59%struct.S = type { i8 } 60define void @test5() { 61entry: 62 %s = alloca %struct.S, align 1 63; CHECK-LABEL: test5: 64; CHECK: subl $12, %esp 65; CHECK: leal 8(%esp), %ecx 66; CHECK: movl $43, (%esp) 67; CHECK: calll {{.*}}thiscallfun 68; CHECK: addl $8, %esp 69 call x86_thiscallcc void @thiscallfun(%struct.S* %s, i32 43) 70 ret void 71} 72declare x86_thiscallcc void @thiscallfun(%struct.S*, i32) #1 73 74; STDERR-NOT: FastISel missed call: call x86_stdcallcc void @stdcallfun 75define void @test6() { 76entry: 77; CHECK-LABEL: test6: 78; CHECK: subl $12, %esp 79; CHECK: movl $43, (%esp) 80; CHECK: calll {{.*}}stdcallfun 81; CHECK: addl $8, %esp 82 call x86_stdcallcc void @stdcallfun(i32 43) 83 ret void 84} 85declare x86_stdcallcc void @stdcallfun(i32) #1 86