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

Unified Diff: test/Transforms/NaCl/atomic/atomic_others.ll

Issue 791053006: Add support for acquire, release, and acq_rel memory ordering in PNaCl (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: test/Transforms/NaCl/atomic/atomic_others.ll
diff --git a/test/Transforms/NaCl/atomic/atomic_others.ll b/test/Transforms/NaCl/atomic/atomic_others.ll
index efc834b3db8502085f37135fbcd0d9ac29e52f5a..9ca90b6a996eb3e072f4276f5f5873bc5b6eec02 100644
--- a/test/Transforms/NaCl/atomic/atomic_others.ll
+++ b/test/Transforms/NaCl/atomic/atomic_others.ll
@@ -1,8 +1,9 @@
; RUN: opt -nacl-rewrite-atomics -S < %s | FileCheck %s
;
-; Validate that atomic non-sequentially consistent loads/stores get rewritten
-; into NaCl atomic builtins with sequentially consistent memory ordering (enum
-; value 6). This will change once we support other memory orderings.
Jim Stichnoth 2015/01/07 21:21:01 Should there be a "this may change..." comment lef
JF 2015/01/07 21:33:57 I'm not sure when/how it'll change: consume will l
+; Validate that atomic non-{acquire/release/acq_rel/seq_cst} loads/stores get
+; rewritten into NaCl atomic builtins with sequentially consistent memory
+; ordering (enum value 6), and that acquire/release/acq_rel remain as-is (enum
+; values 3/4/5).
;
; Note that monotonic doesn't exist in C11/C++11, and consume isn't implemented
; in LLVM yet.
@@ -39,21 +40,21 @@ define void @test_atomic_store_unordered_i32(i32* %ptr, i32 %value) {
; CHECK-LABEL: @test_atomic_load_acquire_i32
define i32 @test_atomic_load_acquire_i32(i32* %ptr) {
- ; CHECK-NEXT: %res = call i32 @llvm.nacl.atomic.load.i32(i32* %ptr, i32 6)
+ ; CHECK-NEXT: %res = call i32 @llvm.nacl.atomic.load.i32(i32* %ptr, i32 3)
%res = load atomic i32* %ptr acquire, align 4
ret i32 %res ; CHECK-NEXT: ret i32 %res
}
; CHECK-LABEL: @test_atomic_store_release_i32
define void @test_atomic_store_release_i32(i32* %ptr, i32 %value) {
- ; CHECK-NEXT: call void @llvm.nacl.atomic.store.i32(i32 %value, i32* %ptr, i32 6)
+ ; CHECK-NEXT: call void @llvm.nacl.atomic.store.i32(i32 %value, i32* %ptr, i32 4)
store atomic i32 %value, i32* %ptr release, align 4
ret void ; CHECK-NEXT: ret void
}
; CHECK: @test_fetch_and_add_i32
define i32 @test_fetch_and_add_i32(i32* %ptr, i32 %value) {
- ; CHECK-NEXT: %res = call i32 @llvm.nacl.atomic.rmw.i32(i32 1, i32* %ptr, i32 %value, i32 6)
+ ; CHECK-NEXT: %res = call i32 @llvm.nacl.atomic.rmw.i32(i32 1, i32* %ptr, i32 %value, i32 5)
%res = atomicrmw add i32* %ptr, i32 %value acq_rel
ret i32 %res ; CHECK-NEXT: ret i32 %res
}

Powered by Google App Engine
This is Rietveld 408576698