Eli Friedman | 9ebfcee | 2011-05-26 18:00:32 +0000 | [diff] [blame^] | 1 | ; RUN: llc < %s -mtriple=i686-apple-darwin10 -fast-isel -fast-isel-abort | FileCheck %s |
| 2 | ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -fast-isel -fast-isel-abort | FileCheck %s |
Dan Gohman | 14ea1ec | 2009-03-13 20:42:20 +0000 | [diff] [blame] | 3 | |
Eli Friedman | 76927d73 | 2011-05-25 23:49:02 +0000 | [diff] [blame] | 4 | declare i32 @test1a(i32) |
Dan Gohman | 14ea1ec | 2009-03-13 20:42:20 +0000 | [diff] [blame] | 5 | |
Eli Friedman | 76927d73 | 2011-05-25 23:49:02 +0000 | [diff] [blame] | 6 | define i32 @test1(i32 %x) nounwind { |
Eli Friedman | 547eb4f | 2011-04-27 01:34:27 +0000 | [diff] [blame] | 7 | ; CHECK: test1: |
| 8 | ; CHECK: andb $1, % |
Eli Friedman | 76927d73 | 2011-05-25 23:49:02 +0000 | [diff] [blame] | 9 | %y = add i32 %x, -3 |
| 10 | %t = call i32 @test1a(i32 %y) |
| 11 | %s = mul i32 %t, 77 |
| 12 | %z = trunc i32 %s to i1 |
Dan Gohman | 14ea1ec | 2009-03-13 20:42:20 +0000 | [diff] [blame] | 13 | br label %next |
| 14 | |
| 15 | next: ; preds = %0 |
Eli Friedman | 547eb4f | 2011-04-27 01:34:27 +0000 | [diff] [blame] | 16 | %u = zext i1 %z to i32 |
| 17 | %v = add i32 %u, 1999 |
Dan Gohman | 14ea1ec | 2009-03-13 20:42:20 +0000 | [diff] [blame] | 18 | br label %exit |
| 19 | |
| 20 | exit: ; preds = %next |
| 21 | ret i32 %v |
| 22 | } |
Eli Friedman | 547eb4f | 2011-04-27 01:34:27 +0000 | [diff] [blame] | 23 | |
| 24 | define void @test2(i8* %a) nounwind { |
| 25 | entry: |
| 26 | ; CHECK: test2: |
| 27 | ; CHECK: movb {{.*}} %al |
| 28 | ; CHECK-NEXT: xorb $1, %al |
| 29 | ; CHECK-NEXT: testb $1 |
| 30 | %tmp = load i8* %a, align 1 |
| 31 | %tobool = trunc i8 %tmp to i1 |
| 32 | %tobool2 = xor i1 %tobool, true |
| 33 | br i1 %tobool2, label %if.then, label %if.end |
| 34 | |
| 35 | if.then: |
| 36 | call void @test2(i8* null) |
| 37 | br label %if.end |
| 38 | |
| 39 | if.end: |
| 40 | ret void |
| 41 | } |