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

Side by Side Diff: test/Transforms/NaCl/replace-ptrs-with-ints.ll

Issue 17777004: Concurrency support for PNaCl ABI (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Fix whitespace. Created 7 years, 5 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
OLDNEW
1 ; RUN: opt %s -replace-ptrs-with-ints -S | FileCheck %s 1 ; RUN: opt %s -replace-ptrs-with-ints -S | FileCheck %s
2 2
3 target datalayout = "p:32:32:32" 3 target datalayout = "p:32:32:32"
4 4
5 5
6 %struct = type { i32, i32 } 6 %struct = type { i32, i32 }
7 7
8 declare %struct* @addr_taken_func(%struct*) 8 declare %struct* @addr_taken_func(%struct*)
9 9
10 @addr_of_func = global %struct* (%struct*)* @addr_taken_func 10 @addr_of_func = global %struct* (%struct*)* @addr_taken_func
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 ; CHECK-NEXT: %x = load i32* %ptr.asptr 237 ; CHECK-NEXT: %x = load i32* %ptr.asptr
238 238
239 define void @store_ptr(i8** %ptr, i8* %val) { 239 define void @store_ptr(i8** %ptr, i8* %val) {
240 store i8* %val, i8** %ptr 240 store i8* %val, i8** %ptr
241 ret void 241 ret void
242 } 242 }
243 ; CHECK: define void @store_ptr(i32 %ptr, i32 %val) { 243 ; CHECK: define void @store_ptr(i32 %ptr, i32 %val) {
244 ; CHECK-NEXT: %ptr.asptr = inttoptr i32 %ptr to i32* 244 ; CHECK-NEXT: %ptr.asptr = inttoptr i32 %ptr to i32*
245 ; CHECK-NEXT: store i32 %val, i32* %ptr.asptr 245 ; CHECK-NEXT: store i32 %val, i32* %ptr.asptr
246 246
247
Mark Seaborn 2013/06/26 16:47:02 Please undo the whitespace changes in this file
JF 2013/06/26 22:56:36 Done.
248 define i8 @load_attrs(i8* %ptr) { 247 define i8 @load_attrs(i8* %ptr) {
249 %x = load atomic volatile i8* %ptr seq_cst, align 128 248 %x = load atomic volatile i8* %ptr seq_cst, align 128
250 ret i8 %x 249 ret i8 %x
251 } 250 }
252 ; CHECK: define i8 @load_attrs(i32 %ptr) { 251 ; CHECK: define i8 @load_attrs(i32 %ptr) {
253 ; CHECK-NEXT: %ptr.asptr = inttoptr i32 %ptr to i8* 252 ; CHECK-NEXT: %ptr.asptr = inttoptr i32 %ptr to i8*
254 ; CHECK-NEXT: %x = load atomic volatile i8* %ptr.asptr seq_cst, align 128 253 ; CHECK-NEXT: %x = load atomic volatile i8* %ptr.asptr seq_cst, align 128
255 254
256 define void @store_attrs(i8* %ptr, i8 %val) { 255 define void @store_attrs(i8* %ptr, i8 %val) {
257 store atomic volatile i8 %val, i8* %ptr singlethread release, align 256 256 store atomic volatile i8 %val, i8* %ptr singlethread release, align 256
(...skipping 13 matching lines...) Expand all
271 ; CHECK-NEXT: %r = cmpxchg i32* %ptr.asptr, i32 %a, i32 %b seq_cst 270 ; CHECK-NEXT: %r = cmpxchg i32* %ptr.asptr, i32 %a, i32 %b seq_cst
272 271
273 define i32 @atomicrmw(i32* %ptr, i32 %x) { 272 define i32 @atomicrmw(i32* %ptr, i32 %x) {
274 %r = atomicrmw add i32* %ptr, i32 %x seq_cst 273 %r = atomicrmw add i32* %ptr, i32 %x seq_cst
275 ret i32 %r 274 ret i32 %r
276 } 275 }
277 ; CHECK: define i32 @atomicrmw(i32 %ptr, i32 %x) { 276 ; CHECK: define i32 @atomicrmw(i32 %ptr, i32 %x) {
278 ; CHECK-NEXT: %ptr.asptr = inttoptr i32 %ptr to i32* 277 ; CHECK-NEXT: %ptr.asptr = inttoptr i32 %ptr to i32*
279 ; CHECK-NEXT: %r = atomicrmw add i32* %ptr.asptr, i32 %x seq_cst 278 ; CHECK-NEXT: %r = atomicrmw add i32* %ptr.asptr, i32 %x seq_cst
280 279
281
282 define i8* @indirect_call(i8* (i8*)* %func, i8* %arg) { 280 define i8* @indirect_call(i8* (i8*)* %func, i8* %arg) {
283 %result = call i8* %func(i8* %arg) 281 %result = call i8* %func(i8* %arg)
284 ret i8* %result 282 ret i8* %result
285 } 283 }
286 ; CHECK: define i32 @indirect_call(i32 %func, i32 %arg) { 284 ; CHECK: define i32 @indirect_call(i32 %func, i32 %arg) {
287 ; CHECK-NEXT: %func.asptr = inttoptr i32 %func to i32 (i32)* 285 ; CHECK-NEXT: %func.asptr = inttoptr i32 %func to i32 (i32)*
288 ; CHECK-NEXT: %result = call i32 %func.asptr(i32 %arg) 286 ; CHECK-NEXT: %result = call i32 %func.asptr(i32 %arg)
289 ; CHECK-NEXT: ret i32 %result 287 ; CHECK-NEXT: ret i32 %result
290 288
291 289
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 %bc = bitcast i32* @typeid to i8* 628 %bc = bitcast i32* @typeid to i8*
631 call i32 @llvm.eh.typeid.for(i8* %bc) 629 call i32 @llvm.eh.typeid.for(i8* %bc)
632 ret void 630 ret void
633 } 631 }
634 ; CHECK: define void @typeid_for() { 632 ; CHECK: define void @typeid_for() {
635 ; CHECK-NEXT: %typeid.bc = bitcast i32* @typeid to i8* 633 ; CHECK-NEXT: %typeid.bc = bitcast i32* @typeid to i8*
636 ; CHECK-NEXT: call i32 @llvm.eh.typeid.for(i8* %typeid.bc) 634 ; CHECK-NEXT: call i32 @llvm.eh.typeid.for(i8* %typeid.bc)
637 635
638 636
639 ; CHECK: attributes {{.*}}[[NOUNWIND]] = { nounwind } 637 ; CHECK: attributes {{.*}}[[NOUNWIND]] = { nounwind }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698