OLD | NEW |
(Empty) | |
| 1 ; Test reading phi instructions. |
| 2 |
| 3 ; RUN: llvm-as < %s | pnacl-freeze -allow-local-symbol-tables \ |
| 4 ; RUN: | %llvm2ice -notranslate -verbose=inst -build-on-read \ |
| 5 ; RUN: -allow-pnacl-reader-error-recovery \ |
| 6 ; RUN: -allow-local-symbol-tables \ |
| 7 ; RUN: | FileCheck %s |
| 8 |
| 9 ; TODO(kschimpf) Add forward reference examples. |
| 10 |
| 11 define internal i32 @testPhi1(i32 %arg) { |
| 12 entry: |
| 13 %cmp1 = icmp sgt i32 %arg, 0 |
| 14 br i1 %cmp1, label %next, label %target |
| 15 next: |
| 16 br label %target |
| 17 target: |
| 18 %merge = phi i1 [ %cmp1, %entry ], [ false, %next ] |
| 19 %result = zext i1 %merge to i32 |
| 20 ret i32 %result |
| 21 } |
| 22 |
| 23 ; CHECK: define internal i32 @testPhi1(i32 %arg) { |
| 24 ; CHECK-NEXT: entry: |
| 25 ; CHECK-NEXT: %cmp1 = icmp sgt i32 %arg, 0 |
| 26 ; CHECK-NEXT: br i1 %cmp1, label %next, label %target |
| 27 ; CHECK-NEXT: next: |
| 28 ; CHECK-NEXT: br label %target |
| 29 ; CHECK-NEXT: target: |
| 30 ; CHECK-NEXT: %merge = phi i1 [ %cmp1, %entry ], [ false, %next ] |
| 31 ; CHECK-NEXT: %result = zext i1 %merge to i32 |
| 32 ; CHECK-NEXT: ret i32 %result |
| 33 ; CHECK-NEXT: } |
| 34 |
OLD | NEW |