Eli Friedman | c088345 | 2011-05-20 22:21:04 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -O0 -fast-isel-abort -march=x86 | FileCheck %s |
Evan Cheng | debdea0 | 2008-09-08 17:15:42 +0000 | [diff] [blame] | 2 | |
Eli Friedman | c088345 | 2011-05-20 22:21:04 +0000 | [diff] [blame] | 3 | %struct.s = type {i32, i32, i32} |
| 4 | |
| 5 | define i32 @test1() nounwind { |
Evan Cheng | debdea0 | 2008-09-08 17:15:42 +0000 | [diff] [blame] | 6 | tak: |
| 7 | %tmp = call i1 @foo() |
| 8 | br i1 %tmp, label %BB1, label %BB2 |
| 9 | BB1: |
| 10 | ret i32 1 |
| 11 | BB2: |
| 12 | ret i32 0 |
Eli Friedman | c088345 | 2011-05-20 22:21:04 +0000 | [diff] [blame] | 13 | ; CHECK: test1: |
Eli Friedman | 19515b4 | 2011-05-17 18:29:03 +0000 | [diff] [blame] | 14 | ; CHECK: calll |
| 15 | ; CHECK-NEXT: testb $1 |
Evan Cheng | debdea0 | 2008-09-08 17:15:42 +0000 | [diff] [blame] | 16 | } |
Evan Cheng | debdea0 | 2008-09-08 17:15:42 +0000 | [diff] [blame] | 17 | declare i1 @foo() zeroext nounwind |
Eli Friedman | c088345 | 2011-05-20 22:21:04 +0000 | [diff] [blame] | 18 | |
| 19 | declare void @foo2(%struct.s* byval) |
| 20 | |
| 21 | define void @test2(%struct.s* %d) nounwind { |
| 22 | call void @foo2(%struct.s* %d byval) |
| 23 | ret void |
| 24 | ; CHECK: test2: |
| 25 | ; CHECK: movl (%eax) |
| 26 | ; CHECK: movl {{.*}}, (%esp) |
| 27 | ; CHECK: movl 4(%eax) |
| 28 | ; CHECK: movl {{.*}}, 4(%esp) |
| 29 | ; CHECK: movl 8(%eax) |
| 30 | ; CHECK: movl {{.*}}, 8(%esp) |
| 31 | } |
Eli Friedman | 25255cb | 2011-06-10 23:39:36 +0000 | [diff] [blame^] | 32 | |
| 33 | declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind |
| 34 | |
| 35 | define void @test3(i8* %a) { |
| 36 | call void @llvm.memset.p0i8.i32(i8* %a, i8 0, i32 100, i32 1, i1 false) |
| 37 | ret void |
| 38 | ; CHECK: test3: |
| 39 | ; CHECK: movl {{.*}}, (%esp) |
| 40 | ; CHECK: movl $0, 4(%esp) |
| 41 | ; CHECK: movl $100, 8(%esp) |
| 42 | ; CHECK: calll {{.*}}memset |
| 43 | } |
| 44 | |
| 45 | declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind |
| 46 | |
| 47 | define void @test4(i8* %a, i8* %b) { |
| 48 | call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %b, i32 100, i32 1, i1 false) |
| 49 | ret void |
| 50 | ; CHECK: test4: |
| 51 | ; CHECK: movl {{.*}}, (%esp) |
| 52 | ; CHECK: movl {{.*}}, 4(%esp) |
| 53 | ; CHECK: movl $100, 8(%esp) |
| 54 | ; CHECK: calll {{.*}}memcpy |
| 55 | } |