OLD | NEW |
(Empty) | |
| 1 ; RUN: opt %s -allocate-data-segment -S | FileCheck %s |
| 2 ; RUN: opt %s -allocate-data-segment -S | FileCheck %s -check-prefix=CLEAN |
| 3 |
| 4 @var1 = global i64 1234 |
| 5 @var2 = global i32 56 |
| 6 |
| 7 @reloc = global i64* @var1 |
| 8 @reloc_end = global i32* getelementptr (i32* @var2, i32 1) |
| 9 |
| 10 |
| 11 ; CHECK: @__sfi_data_segment = constant %data_template { i64 1234, i32 56, i64*
getelementptr (%data_template* inttoptr (i32 65536 to %data_template*), i32 0, i
32 0), i32* getelementptr inbounds (i32* getelementptr (%data_template* inttoptr
(i32 65536 to %data_template*), i32 0, i32 1), i32 1) } |
| 12 |
| 13 ; CHECK: @__sfi_data_segment_size = constant i32 32 |
| 14 |
| 15 ; CLEAN-NOT: @var |
| 16 |
| 17 |
| 18 define i32 @ref_to_var() { |
| 19 %val = load i32* @var2 |
| 20 ret i32 %val |
| 21 } |
| 22 ; CHECK: define i32 @ref_to_var() { |
| 23 ; CHECK-NEXT: %val = load i32* getelementptr (%data_template* inttoptr (i32 6553
6 to %data_template*), i32 0, i32 1) |
OLD | NEW |