Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: test/Transforms/NaCl/flatten-globals.ll

Issue 29743003: Add passes for applying SFI sandboxing at the LLVM IR level Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Retry upload Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/Transforms/NaCl/expand-alloca.ll ('k') | test/Transforms/NaCl/sandbox-indirect-calls.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « test/Transforms/NaCl/expand-alloca.ll ('k') | test/Transforms/NaCl/sandbox-indirect-calls.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698