1 ; RUN: llc < %s -O0 -fast-isel-abort -mtriple=armv7-apple-darwin | FileCheck %s --check-prefix=ARM
2 ; RUN: llc < %s -O0 -fast-isel-abort -mtriple=thumbv7-apple-darwin | FileCheck %s --check-prefix=THUMB
4 ; Very basic fast-isel functionality.
5 define i32 @add(i32 %a, i32 %b) nounwind {
7 %a.addr = alloca i32, align 4
8 %b.addr = alloca i32, align 4
9 store i32 %a, i32* %a.addr
10 store i32 %b, i32* %b.addr
11 %tmp = load i32* %a.addr
12 %tmp1 = load i32* %b.addr
13 %add = add nsw i32 %tmp, %tmp1
17 ; Check truncate to bool
18 define void @test1(i32 %tmp) nounwind {
20 %tobool = trunc i32 %tmp to i1
21 br i1 %tobool, label %if.then, label %if.end
23 if.then: ; preds = %entry
24 call void @test1(i32 0)
27 if.end: ; preds = %if.then, %entry
35 ; Check some simple operations with immediates
36 define void @test2(i32 %tmp, i32* %ptr) nounwind {
41 %a = add i32 %tmp, 4096
42 store i32 %a, i32* %ptr
45 ; THUMB: add.w {{.*}} #4096
46 ; ARM: add {{.*}} #1, #20
49 %b = add i32 %tmp, 4095
50 store i32 %b, i32* %ptr
52 ; THUMB: addw {{.*}} #4095
53 ; ARM: movw {{.*}} #4095
58 store i32 %c, i32* %ptr
61 ; THUMB: orr {{.*}} #4