Evan Cheng | 26118cf | 2011-12-19 23:26:44 +0000 | [diff] [blame^] | 1 | ; RUN: llc < %s -march=arm -mcpu=cortex-a8 | FileCheck %s |
Evan Cheng | 39dfb0f | 2011-07-07 03:55:05 +0000 | [diff] [blame] | 2 | ; RUN: llc < %s -march=arm -mattr=+v4t | grep cmpne | count 1 |
| 3 | ; RUN: llc < %s -march=arm -mattr=+v4t | grep bx | count 2 |
Evan Cheng | 60c916b | 2007-06-20 18:26:15 +0000 | [diff] [blame] | 4 | |
| 5 | define i32 @t1(i32 %a, i32 %b, i32 %c, i32 %d) { |
Evan Cheng | 26118cf | 2011-12-19 23:26:44 +0000 | [diff] [blame^] | 6 | ; CHECK: t1: |
| 7 | ; CHECK: cmp r2, #1 |
| 8 | ; CHECK: cmpne r2, #7 |
Evan Cheng | 60c916b | 2007-06-20 18:26:15 +0000 | [diff] [blame] | 9 | switch i32 %c, label %cond_next [ |
| 10 | i32 1, label %cond_true |
| 11 | i32 7, label %cond_true |
| 12 | ] |
| 13 | |
| 14 | cond_true: |
Evan Cheng | 26118cf | 2011-12-19 23:26:44 +0000 | [diff] [blame^] | 15 | ; CHECK: addne r0 |
| 16 | ; CHECK: bxne |
Evan Cheng | 60c916b | 2007-06-20 18:26:15 +0000 | [diff] [blame] | 17 | %tmp12 = add i32 %a, 1 |
| 18 | %tmp1518 = add i32 %tmp12, %b |
| 19 | ret i32 %tmp1518 |
| 20 | |
| 21 | cond_next: |
| 22 | %tmp15 = add i32 %b, %a |
| 23 | ret i32 %tmp15 |
| 24 | } |