OLD | NEW |
1 ; This tests a switch statement, including multiple branches to the | 1 ; This tests a switch statement, including multiple branches to the |
2 ; same label which also results in phi instructions with multiple | 2 ; same label which also results in phi instructions with multiple |
3 ; entries for the same incoming edge. | 3 ; entries for the same incoming edge. |
4 | 4 |
5 ; RUN: %llvm2ice --verbose inst %s | FileCheck %s | 5 ; RUN: %llvm2ice --verbose inst %s | FileCheck %s |
6 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 6 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
7 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s | 7 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
8 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ | 8 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ |
9 ; RUN: | FileCheck --check-prefix=DUMP %s | 9 ; RUN: | FileCheck --check-prefix=DUMP %s |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 sw.bb2: ; preds = %sw.bb1, %entry, %en
try | 31 sw.bb2: ; preds = %sw.bb1, %entry, %en
try |
32 %result.0 = phi i32 [ 1, %entry ], [ 1, %entry ], [ %phitmp, %sw.bb1 ] | 32 %result.0 = phi i32 [ 1, %entry ], [ 1, %entry ], [ %phitmp, %sw.bb1 ] |
33 br label %sw.epilog | 33 br label %sw.epilog |
34 | 34 |
35 sw.epilog: ; preds = %sw.bb2, %sw.default
, %entry, %entry, %entry | 35 sw.epilog: ; preds = %sw.bb2, %sw.default
, %entry, %entry, %entry |
36 %result.1 = phi i32 [ %add, %sw.default ], [ %result.0, %sw.bb2 ], [ 17, %entr
y ], [ 17, %entry ], [ 17, %entry ] | 36 %result.1 = phi i32 [ %add, %sw.default ], [ %result.0, %sw.bb2 ], [ 17, %entr
y ], [ 17, %entry ], [ 17, %entry ] |
37 ret i32 %result.1 | 37 ret i32 %result.1 |
38 } | 38 } |
39 | 39 |
| 40 ; Check for a valid addressing mode when the switch operand is an |
| 41 ; immediate. It's important that there is exactly one case, because |
| 42 ; for two or more cases the source operand is legalized into a |
| 43 ; register. |
| 44 define i32 @testSwitchImm() { |
| 45 entry: |
| 46 switch i32 10, label %sw.default [ |
| 47 i32 1, label %sw.default |
| 48 ] |
| 49 |
| 50 sw.default: |
| 51 ret i32 20 |
| 52 } |
| 53 ; CHECK-LABEL: testSwitchImm |
| 54 ; CHECK-NOT: cmp {{[0-9]*}}, |
| 55 |
40 ; CHECK-NOT: ICE translation error | 56 ; CHECK-NOT: ICE translation error |
41 ; ERRORS-NOT: ICE translation error | 57 ; ERRORS-NOT: ICE translation error |
42 ; DUMP-NOT: SZ | 58 ; DUMP-NOT: SZ |
OLD | NEW |