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
4 %struct.s = type {i32, i32, i32}
6 define i32 @test1() nounwind {
9 br i1 %tmp, label %BB1, label %BB2
16 ; CHECK-NEXT: testb $1
18 declare zeroext i1 @foo() nounwind
20 declare void @foo2(%struct.s* byval)
22 define void @test2(%struct.s* %d) nounwind {
23 call void @foo2(%struct.s* byval %d )
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)
34 declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) nounwind
36 define void @test3(i8* %a) {
37 call void @llvm.memset.p0i8.i32(i8* %a, i8 0, i32 100, i1 false)
40 ; CHECK: movl {{.*}}, (%esp)
41 ; CHECK: movl $0, 4(%esp)
42 ; CHECK: movl $100, 8(%esp)
43 ; CHECK: calll {{.*}}memset
46 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
48 define void @test4(i8* %a, i8* %b) {
49 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %b, i32 100, i1 false)
52 ; CHECK: movl {{.*}}, (%esp)
53 ; CHECK: movl {{.*}}, 4(%esp)
54 ; CHECK: movl $100, 8(%esp)
55 ; CHECK: calll {{.*}}memcpy
58 ; STDERR-NOT: FastISel missed call: call x86_thiscallcc void @thiscallfun
59 %struct.S = type { i8 }
60 define void @test5() {
62 %s = alloca %struct.S, align 1
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)
72 declare x86_thiscallcc void @thiscallfun(%struct.S*, i32) #1
74 ; STDERR-NOT: FastISel missed call: call x86_stdcallcc void @stdcallfun
75 define void @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)
85 declare x86_stdcallcc void @stdcallfun(i32) #1