Evan Cheng | 309db7c | 2011-04-27 19:32:43 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=thumbv7-apple-ios |
| 2 | |
| 3 | ; If converter was being too cute. It look for root BBs (which don't have |
| 4 | ; successors) and use inverse depth first search to traverse the BBs. However |
| 5 | ; that doesn't work when the CFG has infinite loops. Simply do a linear |
| 6 | ; traversal of all BBs work just fine. |
| 7 | |
| 8 | ; rdar://9344645 |
| 9 | |
| 10 | %struct.hc = type { i32, i32, i32, i32 } |
| 11 | |
| 12 | define i32 @t(i32 %type) optsize { |
| 13 | entry: |
| 14 | br i1 undef, label %if.then, label %if.else |
| 15 | |
| 16 | if.then: |
| 17 | unreachable |
| 18 | |
| 19 | if.else: |
| 20 | br i1 undef, label %if.then15, label %if.else18 |
| 21 | |
| 22 | if.then15: |
| 23 | unreachable |
| 24 | |
| 25 | if.else18: |
| 26 | switch i32 %type, label %if.else173 [ |
| 27 | i32 3, label %if.then115 |
| 28 | i32 1, label %if.then102 |
| 29 | ] |
| 30 | |
| 31 | if.then102: |
| 32 | br i1 undef, label %cond.true10.i, label %t.exit |
| 33 | |
| 34 | cond.true10.i: |
| 35 | br label %t.exit |
| 36 | |
| 37 | t.exit: |
| 38 | unreachable |
| 39 | |
| 40 | if.then115: |
| 41 | br i1 undef, label %if.else163, label %if.else145 |
| 42 | |
| 43 | if.else145: |
| 44 | %call150 = call fastcc %struct.hc* @foo(%struct.hc* undef, i32 34865152) optsize |
| 45 | br label %while.body172 |
| 46 | |
| 47 | if.else163: |
| 48 | %call168 = call fastcc %struct.hc* @foo(%struct.hc* undef, i32 34078720) optsize |
| 49 | br label %while.body172 |
| 50 | |
| 51 | while.body172: |
| 52 | br label %while.body172 |
| 53 | |
| 54 | if.else173: |
| 55 | ret i32 -1 |
| 56 | } |
| 57 | |
| 58 | declare hidden fastcc %struct.hc* @foo(%struct.hc* nocapture, i32) nounwind optsize |
| 59 | |