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