OLD | NEW |
1 ; Test parsing indirect calls in Subzero. | 1 ; Test parsing indirect calls in Subzero. |
2 | 2 |
3 ; REQUIRES: allow_dump | |
4 | |
5 ; RUN: %p2i -i %s --insts | FileCheck %s | 3 ; RUN: %p2i -i %s --insts | FileCheck %s |
6 ; RUN: %if --need=allow_disable_ir_gen --command \ | 4 ; RUN: %if --need=allow_disable_ir_gen --command \ |
7 ; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \ | 5 ; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \ |
8 ; RUN: | %if --need=allow_disable_ir_gen --command \ | 6 ; RUN: | %if --need=allow_disable_ir_gen --command \ |
9 ; RUN: FileCheck --check-prefix=NOIR %s | 7 ; RUN: FileCheck --check-prefix=NOIR %s |
10 | 8 |
11 define internal void @CallIndirectVoid(i32 %f_addr) { | 9 define internal void @CallIndirectVoid(i32 %f_addr) { |
12 entry: | 10 entry: |
13 %f = inttoptr i32 %f_addr to void ()* | 11 %f = inttoptr i32 %f_addr to void ()* |
14 call void %f() | 12 call void %f() |
(...skipping 13 matching lines...) Expand all Loading... |
28 ret i32 %r | 26 ret i32 %r |
29 } | 27 } |
30 | 28 |
31 ; CHECK-NEXT: define internal i32 @CallIndirectI32(i32 %f_addr) { | 29 ; CHECK-NEXT: define internal i32 @CallIndirectI32(i32 %f_addr) { |
32 ; CHECK-NEXT: entry: | 30 ; CHECK-NEXT: entry: |
33 ; CHECK-NEXT: %r = call i32 %f_addr(i8 1, i1 false) | 31 ; CHECK-NEXT: %r = call i32 %f_addr(i8 1, i1 false) |
34 ; CHECK-NEXT: ret i32 %r | 32 ; CHECK-NEXT: ret i32 %r |
35 ; CHECK-NEXT: } | 33 ; CHECK-NEXT: } |
36 | 34 |
37 ; NOIR: Total across all functions | 35 ; NOIR: Total across all functions |
OLD | NEW |