Eric Christopher | 836c624 | 2010-12-15 23:47:29 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -O0 -relocation-model=static -arm-long-calls | FileCheck -check-prefix=LONG %s |
| 2 | ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -O0 -relocation-model=static | FileCheck -check-prefix=NORM %s |
| 3 | |
| 4 | define void @myadd(float* %sum, float* %addend) nounwind { |
| 5 | entry: |
| 6 | %sum.addr = alloca float*, align 4 |
| 7 | %addend.addr = alloca float*, align 4 |
| 8 | store float* %sum, float** %sum.addr, align 4 |
| 9 | store float* %addend, float** %addend.addr, align 4 |
| 10 | %tmp = load float** %sum.addr, align 4 |
| 11 | %tmp1 = load float* %tmp |
| 12 | %tmp2 = load float** %addend.addr, align 4 |
| 13 | %tmp3 = load float* %tmp2 |
| 14 | %add = fadd float %tmp1, %tmp3 |
| 15 | %tmp4 = load float** %sum.addr, align 4 |
| 16 | store float %add, float* %tmp4 |
| 17 | ret void |
| 18 | } |
| 19 | |
| 20 | define i32 @main(i32 %argc, i8** %argv) nounwind { |
| 21 | entry: |
| 22 | %ztot = alloca float, align 4 |
| 23 | %z = alloca float, align 4 |
| 24 | store float 0.000000e+00, float* %ztot, align 4 |
| 25 | store float 1.000000e+00, float* %z, align 4 |
Jakob Stoklund Olesen | 5e5ed44 | 2011-06-13 03:26:46 +0000 | [diff] [blame] | 26 | ; CHECK-LONG: blx r |
Eric Christopher | 4fccc86 | 2011-04-05 00:56:01 +0000 | [diff] [blame] | 27 | ; CHECK-NORM: bl _myadd |
Eric Christopher | 836c624 | 2010-12-15 23:47:29 +0000 | [diff] [blame] | 28 | call void @myadd(float* %ztot, float* %z) |
| 29 | ret i32 0 |
| 30 | } |