OLD | NEW |
1 ; Test of multiple indirect calls to the same target. Each call | 1 ; Test of multiple indirect calls to the same target. Each call |
2 ; should be to the same operand, whether it's in a register or on the | 2 ; should be to the same operand, whether it's in a register or on the |
3 ; stack. | 3 ; stack. |
4 | 4 |
5 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 \ | 5 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 \ |
6 ; RUN: | FileCheck %s | 6 ; RUN: | FileCheck %s |
| 7 ; RUN: %if --need=allow_dump --command %p2i --filetype=asm --assemble \ |
| 8 ; RUN: --disassemble -i %s --args -O2 \ |
| 9 ; RUN: | %if --need=allow_dump --command FileCheck %s |
7 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 \ | 10 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 \ |
8 ; RUN: | FileCheck --check-prefix=OPTM1 %s | 11 ; RUN: | FileCheck --check-prefix=OPTM1 %s |
9 | 12 |
10 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 | 13 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 |
11 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 | 14 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 |
12 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 | 15 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 |
13 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 | 16 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 |
14 | 17 |
15 define internal void @CallIndirect(i32 %f) { | 18 define internal void @CallIndirect(i32 %f) { |
16 entry: | 19 entry: |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 ; CHECK: call [[REGISTER]] | 58 ; CHECK: call [[REGISTER]] |
56 ; CHECK: call [[REGISTER]] | 59 ; CHECK: call [[REGISTER]] |
57 ; | 60 ; |
58 ; OPTM1-LABEL: CallIndirectGlobal | 61 ; OPTM1-LABEL: CallIndirectGlobal |
59 ; OPTM1: call [[TARGET:.+]] | 62 ; OPTM1: call [[TARGET:.+]] |
60 ; OPTM1: call [[TARGET]] | 63 ; OPTM1: call [[TARGET]] |
61 ; OPTM1: call [[TARGET]] | 64 ; OPTM1: call [[TARGET]] |
62 ; OPTM1: call [[TARGET]] | 65 ; OPTM1: call [[TARGET]] |
63 | 66 |
64 ; Calling an absolute address is used for non-IRT PNaCl pexes to directly | 67 ; Calling an absolute address is used for non-IRT PNaCl pexes to directly |
65 ; access syscall trampolines. Do we need to support this? | 68 ; access syscall trampolines. This is not really an indirect call, but |
66 ; define internal void @CallIndirectConst() { | 69 ; there is a cast from int to pointer first. |
67 ; entry: | 70 define internal void @CallConst() { |
68 ; %__1 = inttoptr i32 66496 to void ()* | 71 entry: |
69 ; call void %__1() | 72 %__1 = inttoptr i32 66496 to void ()* |
70 ; call void %__1() | 73 call void %__1() |
71 ; call void %__1() | 74 call void %__1() |
72 ; call void %__1() | 75 call void %__1() |
73 ; call void %__1() | 76 ret void |
74 ; ret void | 77 } |
75 ; } | 78 |
| 79 ; CHECK-LABEL: CallConst |
| 80 ; CHECK: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS* |
| 81 ; CHECK: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS* |
| 82 ; CHECK: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS* |
| 83 ; |
| 84 ; OPTM1-LABEL: CallConst |
| 85 ; OPTM1: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS* |
| 86 ; OPTM1: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS* |
| 87 ; OPTM1: e8 bc 03 01 00 call {{[0-9a-f]+}} {{.*}} R_386_PC32 *ABS* |
OLD | NEW |