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

Side by Side Diff: test/Transforms/NaCl/atomic/sync_synchronize.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 9 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
(Empty)
1 ; RUN: opt -nacl-rewrite-atomics -remove-asm-memory -S < %s | FileCheck %s
2
3 ; Each of these tests validates that the corresponding legacy GCC-style builtins
4 ; are properly rewritten to NaCl atomic builtins. Only the GCC-style builtins
5 ; that have corresponding primitives in C11/C++11 and which emit different code
6 ; are tested. These legacy GCC-builtins only support sequential-consistency
7 ; (enum value 6).
8 ;
9 ; test_* tests the corresponding __sync_* builtin. See:
10 ; http://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc/_005f_005fsync-Builtins.html
11
12 target datalayout = "p:32:32:32"
13
14 ; This patterns gets emitted by C11/C++11 atomic thread fences.
15 ;
16 ; CHECK-LABEL: @test_c11_fence
17 define void @test_c11_fence() {
18 ; CHECK-NEXT: call void @llvm.nacl.atomic.fence(i32 6)
19 fence seq_cst
20 ret void ; CHECK-NEXT: ret void
21 }
22
23 ; This pattern gets emitted for ``__sync_synchronize`` and
24 ; ``asm("":::"memory")`` when Clang is configured for NaCl.
25 ;
26 ; CHECK-LABEL: @test_synchronize
27 define void @test_synchronize() {
28 ; CHECK-NEXT: call void @llvm.nacl.atomic.fence.all()
29 call void asm sideeffect "", "~{memory}"()
30 fence seq_cst
31 call void asm sideeffect "", "~{memory}"()
32 ret void ; CHECK-NEXT: ret void
33 }
34
35 ; Make sure the above pattern is respected and not partially-matched.
36 ;
37 ; CHECK-LABEL: @test_synchronize_bad1
38 define void @test_synchronize_bad1() {
39 ; CHECK-NOT: call void @llvm.nacl.atomic.fence.all()
40 call void asm sideeffect "", "~{memory}"()
41 fence seq_cst
42 ret void
43 }
44
45 ; CHECK-LABEL: @test_synchronize_bad2
46 define void @test_synchronize_bad2() {
47 ; CHECK-NOT: call void @llvm.nacl.atomic.fence.all()
48 fence seq_cst
49 call void asm sideeffect "", "~{memory}"()
50 ret void
51 }
OLDNEW
« no previous file with comments | « test/Transforms/NaCl/atomic/lock_.ll ('k') | test/Transforms/NaCl/atomic/val_compare_and_swap.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698