llvm.org GIT mirror llvm / 3a594f4
FileCheck-ize a couple tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135427 91177308-0d34-0410-b5e6-96231b3b80d8 Eli Friedman 8 years ago
2 changed file(s) with 22 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -march=ppc32 | grep lwarx | count 3
1 ; RUN: llc < %s -march=ppc32 | grep stwcx. | count 4
0 ; RUN: llc < %s -march=ppc32 | FileCheck %s
21
32 define i32 @exchange_and_add(i32* %mem, i32 %val) nounwind {
3 ; CHECK: exchange_and_add:
4 ; CHECK: lwarx
45 %tmp = call i32 @llvm.atomic.load.add.i32.p0i32(i32* %mem, i32 %val)
6 ; CHECK: stwcx.
57 ret i32 %tmp
68 }
79
810 define i32 @exchange_and_cmp(i32* %mem) nounwind {
11 ; CHECK: exchange_and_cmp:
12 ; CHECK: lwarx
913 %tmp = call i32 @llvm.atomic.cmp.swap.i32.p0i32(i32* %mem, i32 0, i32 1)
14 ; CHECK: stwcx.
15 ; CHECK: stwcx.
1016 ret i32 %tmp
1117 }
1218
1319 define i32 @exchange(i32* %mem, i32 %val) nounwind {
20 ; CHECK: exchange:
21 ; CHECK: lwarx
1422 %tmp = call i32 @llvm.atomic.swap.i32.p0i32(i32* %mem, i32 1)
23 ; CHECK: stwcx.
1524 ret i32 %tmp
1625 }
1726
None ; RUN: llc < %s -march=ppc64 | grep ldarx | count 3
1 ; RUN: llc < %s -march=ppc64 | grep stdcx. | count 4
0 ; RUN: llc < %s -march=ppc64 | FileCheck %s
21
32 define i64 @exchange_and_add(i64* %mem, i64 %val) nounwind {
3 ; CHECK: exchange_and_add:
4 ; CHECK: ldarx
45 %tmp = call i64 @llvm.atomic.load.add.i64.p0i64(i64* %mem, i64 %val)
6 ; CHECK: stdcx.
57 ret i64 %tmp
68 }
79
810 define i64 @exchange_and_cmp(i64* %mem) nounwind {
11 ; CHECK: exchange_and_cmp:
12 ; CHECK: ldarx
913 %tmp = call i64 @llvm.atomic.cmp.swap.i64.p0i64(i64* %mem, i64 0, i64 1)
14 ; CHECK: stdcx.
15 ; CHECK: stdcx.
1016 ret i64 %tmp
1117 }
1218
1319 define i64 @exchange(i64* %mem, i64 %val) nounwind {
20 ; CHECK: exchange:
21 ; CHECK: ldarx
1422 %tmp = call i64 @llvm.atomic.swap.i64.p0i64(i64* %mem, i64 1)
23 ; CHECK: stdcx.
1524 ret i64 %tmp
1625 }
1726