OLD | NEW |
1 ; RUIN: %llvm2ice -verbose inst %s | FileCheck %s | 1 ; Simple smoke test of the call instruction. The assembly checks |
2 ; RUIN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 2 ; currently only verify the function labels. |
| 3 |
| 4 ; RUN: %llvm2ice --verbose inst %s | FileCheck %s |
| 5 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
3 ; RUN: %szdiff --llvm2ice=%llvm2ice %s | FileCheck --check-prefix=DUMP %s | 6 ; RUN: %szdiff --llvm2ice=%llvm2ice %s | FileCheck --check-prefix=DUMP %s |
4 | 7 |
5 define i32 @fib(i32 %n) { | 8 define i32 @fib(i32 %n) { |
6 ; CHECK: define i32 @fib | 9 ; CHECK: define i32 @fib |
7 entry: | 10 entry: |
8 %cmp = icmp slt i32 %n, 2 | 11 %cmp = icmp slt i32 %n, 2 |
9 br i1 %cmp, label %return, label %if.end | 12 br i1 %cmp, label %return, label %if.end |
10 | 13 |
11 if.end: ; preds = %entry | 14 if.end: ; preds = %entry |
12 %sub = add i32 %n, -1 | 15 %sub = add i32 %n, -1 |
(...skipping 27 matching lines...) Expand all Loading... |
40 ; CHECK: define i32 @redirect | 43 ; CHECK: define i32 @redirect |
41 entry: | 44 entry: |
42 %call = tail call i32 @redirect_target(i32 %n) | 45 %call = tail call i32 @redirect_target(i32 %n) |
43 ret i32 %call | 46 ret i32 %call |
44 } | 47 } |
45 | 48 |
46 declare i32 @redirect_target(i32) | 49 declare i32 @redirect_target(i32) |
47 | 50 |
48 define void @call_void(i32 %n) { | 51 define void @call_void(i32 %n) { |
49 ; CHECK: define void @call_void | 52 ; CHECK: define void @call_void |
| 53 |
50 entry: | 54 entry: |
51 %cmp2 = icmp sgt i32 %n, 0 | 55 %cmp2 = icmp sgt i32 %n, 0 |
52 br i1 %cmp2, label %if.then, label %if.end | 56 br i1 %cmp2, label %if.then, label %if.end |
53 | 57 |
54 if.then: ; preds = %entry, %if.then | 58 if.then: ; preds = %entry, %if.then |
55 %n.tr3 = phi i32 [ %call.i, %if.then ], [ %n, %entry ] | 59 %n.tr3 = phi i32 [ %call.i, %if.then ], [ %n, %entry ] |
56 %sub = add i32 %n.tr3, -1 | 60 %sub = add i32 %n.tr3, -1 |
57 %call.i = tail call i32 @redirect_target(i32 %sub) | 61 %call.i = tail call i32 @redirect_target(i32 %sub) |
58 %cmp = icmp sgt i32 %call.i, 0 | 62 %cmp = icmp sgt i32 %call.i, 0 |
59 br i1 %cmp, label %if.then, label %if.end | 63 br i1 %cmp, label %if.then, label %if.end |
60 | 64 |
61 if.end: ; preds = %if.then, %entry | 65 if.end: ; preds = %if.then, %entry |
62 ret void | 66 ret void |
63 } | 67 } |
64 | 68 |
65 ; ERRORS-NOT: ICE translation error | 69 ; ERRORS-NOT: ICE translation error |
66 ; DUMP-NOT: SZ | 70 ; DUMP-NOT: SZ |
OLD | NEW |