OLD | NEW |
1 ; RUN: opt -flatten-globals %s -S | FileCheck %s | 1 ; RUN: opt -flatten-globals %s -S | FileCheck %s |
2 ; RUN: opt -flatten-globals %s -S | FileCheck %s -check-prefix=CLEANED | 2 ; RUN: opt -flatten-globals %s -S | FileCheck %s -check-prefix=CLEANED |
3 | 3 |
4 target datalayout = "p:32:32:32" | 4 target datalayout = "p:32:32:32" |
5 | 5 |
6 | 6 |
7 ; Check simple cases | 7 ; Check simple cases |
8 | 8 |
9 @var_i32 = global i32 258 | 9 @var_i32 = global i32 258 |
10 ; CHECK: @var_i32 = global [4 x i8] c"\02\01\00\00" | 10 ; CHECK: @var_i32 = global [4 x i8] c"\02\01\00\00" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 @block_addr = global i8* blockaddress(@func_with_block, %label) | 144 @block_addr = global i8* blockaddress(@func_with_block, %label) |
145 ; CHECK: @block_addr = global i32 ptrtoint (i8* blockaddress(@func_with_block, %
label) to i32) | 145 ; CHECK: @block_addr = global i32 ptrtoint (i8* blockaddress(@func_with_block, %
label) to i32) |
146 | 146 |
147 @vector_reloc = global <2 x i32*> <i32* @var1, i32* @var1> | 147 @vector_reloc = global <2 x i32*> <i32* @var1, i32* @var1> |
148 ; CHECK: global <{ i32, i32 }> <{ i32 ptrtoint ([4 x i8]* @var1 to i32), i32 ptr
toint ([4 x i8]* @var1 to i32) }> | 148 ; CHECK: global <{ i32, i32 }> <{ i32 ptrtoint ([4 x i8]* @var1 to i32), i32 ptr
toint ([4 x i8]* @var1 to i32) }> |
149 | 149 |
150 | 150 |
151 ; Global references with addends | 151 ; Global references with addends |
152 | 152 |
| 153 @reloc_addend_add = global i32 add (i32 ptrtoint (%ptrs1* @ptrs1 to i32), i32 8) |
| 154 ; CHECK: global i32 add (i32 ptrtoint (<{ i32, [8 x i8] }>* @ptrs1 to i32), i32
8) |
| 155 |
153 @reloc_addend = global i32* getelementptr (%ptrs1* @ptrs1, i32 0, i32 2) | 156 @reloc_addend = global i32* getelementptr (%ptrs1* @ptrs1, i32 0, i32 2) |
154 ; CHECK: @reloc_addend = global i32 add (i32 ptrtoint (<{ i32, [8 x i8] }>* @ptr
s1 to i32), i32 8) | 157 ; CHECK: @reloc_addend = global i32 add (i32 ptrtoint (<{ i32, [8 x i8] }>* @ptr
s1 to i32), i32 8) |
155 | 158 |
156 @negative_addend = global %ptrs1* getelementptr (%ptrs1* @ptrs1, i32 -1) | 159 @negative_addend = global %ptrs1* getelementptr (%ptrs1* @ptrs1, i32 -1) |
157 ; CHECK: @negative_addend = global i32 add (i32 ptrtoint (<{ i32, [8 x i8] }>* @
ptrs1 to i32), i32 -12) | 160 ; CHECK: @negative_addend = global i32 add (i32 ptrtoint (<{ i32, [8 x i8] }>* @
ptrs1 to i32), i32 -12) |
158 | 161 |
159 @const_ptr = global i32* getelementptr (%ptrs1* null, i32 0, i32 2) | 162 @const_ptr = global i32* getelementptr (%ptrs1* null, i32 0, i32 2) |
160 ; CHECK: @const_ptr = global [4 x i8] c"\08\00\00\00" | 163 ; CHECK: @const_ptr = global [4 x i8] c"\08\00\00\00" |
161 | 164 |
162 @int_to_ptr = global i32* inttoptr (i16 260 to i32*) | 165 @int_to_ptr = global i32* inttoptr (i16 260 to i32*) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 201 } |
199 ; CHECK: define i32* @get_address() { | 202 ; CHECK: define i32* @get_address() { |
200 ; CHECK-NEXT: ret i32* bitcast ([4 x i8]* @var_i32 to i32*) | 203 ; CHECK-NEXT: ret i32* bitcast ([4 x i8]* @var_i32 to i32*) |
201 | 204 |
202 | 205 |
203 define void @func_with_block() { | 206 define void @func_with_block() { |
204 br label %label | 207 br label %label |
205 label: | 208 label: |
206 ret void | 209 ret void |
207 } | 210 } |
OLD | NEW |