2015-02-28 02:32:11 +08:00
|
|
|
; RUN: llc < %s -O0 -fast-isel-abort=1 -march=x86 | FileCheck %s
|
2008-09-09 01:15:42 +08:00
|
|
|
|
2011-05-21 06:21:04 +08:00
|
|
|
%struct.s = type {i32, i32, i32}
|
|
|
|
|
|
|
|
define i32 @test1() nounwind {
|
2008-09-09 01:15:42 +08:00
|
|
|
tak:
|
|
|
|
%tmp = call i1 @foo()
|
|
|
|
br i1 %tmp, label %BB1, label %BB2
|
|
|
|
BB1:
|
|
|
|
ret i32 1
|
|
|
|
BB2:
|
|
|
|
ret i32 0
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test1:
|
2011-05-18 02:29:03 +08:00
|
|
|
; CHECK: calll
|
|
|
|
; CHECK-NEXT: testb $1
|
2008-09-09 01:15:42 +08:00
|
|
|
}
|
2011-06-17 11:14:27 +08:00
|
|
|
declare zeroext i1 @foo() nounwind
|
2011-05-21 06:21:04 +08:00
|
|
|
|
|
|
|
declare void @foo2(%struct.s* byval)
|
|
|
|
|
|
|
|
define void @test2(%struct.s* %d) nounwind {
|
2011-06-17 11:14:27 +08:00
|
|
|
call void @foo2(%struct.s* byval %d )
|
2011-05-21 06:21:04 +08:00
|
|
|
ret void
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test2:
|
2011-05-21 06:21:04 +08:00
|
|
|
; CHECK: movl (%eax)
|
|
|
|
; CHECK: movl {{.*}}, (%esp)
|
|
|
|
; CHECK: movl 4(%eax)
|
|
|
|
; CHECK: movl {{.*}}, 4(%esp)
|
|
|
|
; CHECK: movl 8(%eax)
|
|
|
|
; CHECK: movl {{.*}}, 8(%esp)
|
|
|
|
}
|
2011-06-11 07:39:36 +08:00
|
|
|
|
2015-11-19 13:56:52 +08:00
|
|
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
2011-06-11 07:39:36 +08:00
|
|
|
|
|
|
|
define void @test3(i8* %a) {
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %a, i8 0, i32 100, i32 1, i1 false)
|
2011-06-11 07:39:36 +08:00
|
|
|
ret void
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test3:
|
2011-06-11 07:39:36 +08:00
|
|
|
; CHECK: movl {{.*}}, (%esp)
|
|
|
|
; CHECK: movl $0, 4(%esp)
|
|
|
|
; CHECK: movl $100, 8(%esp)
|
|
|
|
; CHECK: calll {{.*}}memset
|
|
|
|
}
|
|
|
|
|
2015-11-19 13:56:52 +08:00
|
|
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
2011-06-11 07:39:36 +08:00
|
|
|
|
|
|
|
define void @test4(i8* %a, i8* %b) {
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %b, i32 100, i32 1, i1 false)
|
2011-06-11 07:39:36 +08:00
|
|
|
ret void
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test4:
|
2011-06-11 07:39:36 +08:00
|
|
|
; CHECK: movl {{.*}}, (%esp)
|
|
|
|
; CHECK: movl {{.*}}, 4(%esp)
|
|
|
|
; CHECK: movl $100, 8(%esp)
|
|
|
|
; CHECK: calll {{.*}}memcpy
|
|
|
|
}
|