Reed Kotler | 96b7402 | 2014-03-10 16:31:25 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=mipsel -O0 < %s | FileCheck %s |
| 2 | |
| 3 | ; Function Attrs: nounwind |
| 4 | define i32 @main() { |
| 5 | entry: |
| 6 | %retval = alloca i32, align 4 |
| 7 | %i = alloca i32, align 4 |
| 8 | store i32 0, i32* %retval |
| 9 | store i32 0, i32* %i, align 4 |
| 10 | br label %for.cond |
| 11 | |
| 12 | for.cond: ; preds = %for.inc, %entry |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 13 | %0 = load i32, i32* %i, align 4 |
Reed Kotler | 96b7402 | 2014-03-10 16:31:25 +0000 | [diff] [blame] | 14 | %cmp = icmp slt i32 %0, 10 |
| 15 | br i1 %cmp, label %for.body, label %for.end |
| 16 | |
| 17 | for.body: ; preds = %for.cond |
| 18 | call void bitcast (void (...)* @foo to void ()*)() |
| 19 | ; CHECK: jalr $25 |
| 20 | br label %for.inc |
| 21 | |
| 22 | for.inc: ; preds = %for.body |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 23 | %1 = load i32, i32* %i, align 4 |
Reed Kotler | 96b7402 | 2014-03-10 16:31:25 +0000 | [diff] [blame] | 24 | %inc = add nsw i32 %1, 1 |
| 25 | store i32 %inc, i32* %i, align 4 |
| 26 | br label %for.cond |
| 27 | |
| 28 | for.end: ; preds = %for.cond |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 29 | %2 = load i32, i32* %retval |
Reed Kotler | 96b7402 | 2014-03-10 16:31:25 +0000 | [diff] [blame] | 30 | ret i32 %2 |
| 31 | } |
| 32 | |
| 33 | declare void @foo(...) |