Evan Cheng | a7c7b54 | 2011-04-07 00:58:44 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=arm-apple-darwin -use-divmod-libcall | FileCheck %s |
Evan Cheng | a6a992a | 2011-04-01 06:27:25 +0000 | [diff] [blame] | 2 | |
| 3 | define void @foo(i32 %x, i32 %y, i32* nocapture %P) nounwind ssp { |
| 4 | entry: |
| 5 | ; CHECK: foo: |
| 6 | ; CHECK: bl ___divmodsi4 |
| 7 | ; CHECK-NOT: bl ___divmodsi4 |
| 8 | %div = sdiv i32 %x, %y |
| 9 | store i32 %div, i32* %P, align 4 |
| 10 | %rem = srem i32 %x, %y |
| 11 | %arrayidx6 = getelementptr inbounds i32* %P, i32 1 |
| 12 | store i32 %rem, i32* %arrayidx6, align 4 |
| 13 | ret void |
| 14 | } |
| 15 | |
| 16 | define void @bar(i32 %x, i32 %y, i32* nocapture %P) nounwind ssp { |
| 17 | entry: |
| 18 | ; CHECK: bar: |
| 19 | ; CHECK: bl ___udivmodsi4 |
| 20 | ; CHECK-NOT: bl ___udivmodsi4 |
| 21 | %div = udiv i32 %x, %y |
| 22 | store i32 %div, i32* %P, align 4 |
| 23 | %rem = urem i32 %x, %y |
| 24 | %arrayidx6 = getelementptr inbounds i32* %P, i32 1 |
| 25 | store i32 %rem, i32* %arrayidx6, align 4 |
| 26 | ret void |
| 27 | } |