brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 84632c6 Raw
93 lines · plain
1; RUN: llc < %s -O0 -fast-isel-abort=1 -mtriple=i686-apple-darwin8 2>/dev/null | FileCheck %s2; RUN: llc < %s -O0 -fast-isel-abort=1 -mtriple=i686-apple-darwin8 2>&1 >/dev/null | FileCheck -check-prefix=STDERR -allow-empty %s3; RUN: llc < %s -O0 -fast-isel-abort=1 -mtriple=i686 2>/dev/null | FileCheck %s --check-prefix=ELF4 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 %BB211BB1:12	ret i32 113BB2:14	ret i32 015; CHECK-LABEL: test1:16; CHECK: calll17; CHECK-NEXT: testb	$118}19declare zeroext i1 @foo()  nounwind20 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 void26; CHECK-LABEL: test2:27; CHECK: movl	(%eax), %ecx28; CHECK: movl	%ecx, (%esp)29; CHECK: movl	4(%eax), %ecx30; CHECK: movl	%ecx, 4(%esp)31; CHECK: movl	8(%eax), %eax32; CHECK: movl	%eax, 8(%esp)33}34 35declare void @llvm.memset.p0.i32(ptr nocapture, i8, i32, i1) nounwind36 37define void @test3(ptr %a) {38  call void @llvm.memset.p0.i32(ptr %a, i8 0, i32 100, i1 false)39  ret void40; CHECK-LABEL: test3:41; CHECK:   movl	{{.*}}, (%esp)42; CHECK:   movl	$0, 4(%esp)43; CHECK:   movl	$100, 8(%esp)44; CHECK:   calll {{.*}}memset45 46; ELF-LABEL: test3:47; ELF:         calll memset{{$}}48}49 50declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1) nounwind51 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 void55; CHECK-LABEL: test4:56; CHECK:   movl	{{.*}}, (%esp)57; CHECK:   movl	{{.*}}, 4(%esp)58; CHECK:   movl	$100, 8(%esp)59; CHECK:   calll {{.*}}memcpy60 61; ELF-LABEL: test4:62; ELF:         calll memcpy{{$}}63}64 65; STDERR-NOT: FastISel missed call:   call x86_thiscallcc void @thiscallfun66%struct.S = type { i8 }67define void @test5() {68entry:69  %s = alloca %struct.S, align 870; CHECK-LABEL: test5:71; CHECK: subl $12, %esp72; CHECK: leal 8(%esp), %ecx73; CHECK: movl $43, (%esp)74; CHECK: calll {{.*}}thiscallfun75; CHECK: addl $8, %esp76  call x86_thiscallcc void @thiscallfun(ptr %s, i32 43)77  ret void78}79declare x86_thiscallcc void @thiscallfun(ptr, i32) #180 81; STDERR-NOT: FastISel missed call:   call x86_stdcallcc void @stdcallfun82define void @test6() {83entry:84; CHECK-LABEL: test6:85; CHECK: subl $12, %esp86; CHECK: movl $43, (%esp)87; CHECK: calll {{.*}}stdcallfun88; CHECK: addl $8, %esp89  call x86_stdcallcc void @stdcallfun(i32 43)90  ret void91}92declare x86_stdcallcc void @stdcallfun(i32) #193