1; Test memory-to-memory ORs.
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4
5; Test the simple i8 case.
6define void @f1(i8 *%ptr1) {
7; CHECK-LABEL: f1:
8; CHECK: oc 1(1,%r2), 0(%r2)
9; CHECK: br %r14
10  %ptr2 = getelementptr i8, i8 *%ptr1, i64 1
11  %val = load i8 , i8 *%ptr1
12  %old = load i8 , i8 *%ptr2
13  %or = or i8 %val, %old
14  store i8 %or, i8 *%ptr2
15  ret void
16}
17
18; Test the simple i16 case.
19define void @f2(i16 *%ptr1) {
20; CHECK-LABEL: f2:
21; CHECK: oc 2(2,%r2), 0(%r2)
22; CHECK: br %r14
23  %ptr2 = getelementptr i16, i16 *%ptr1, i64 1
24  %val = load i16 , i16 *%ptr1
25  %old = load i16 , i16 *%ptr2
26  %or = or i16 %val, %old
27  store i16 %or, i16 *%ptr2
28  ret void
29}
30
31; Test the simple i32 case.
32define void @f3(i32 *%ptr1) {
33; CHECK-LABEL: f3:
34; CHECK: oc 4(4,%r2), 0(%r2)
35; CHECK: br %r14
36  %ptr2 = getelementptr i32, i32 *%ptr1, i64 1
37  %val = load i32 , i32 *%ptr1
38  %old = load i32 , i32 *%ptr2
39  %or = or i32 %old, %val
40  store i32 %or, i32 *%ptr2
41  ret void
42}
43
44; Test the i64 case.
45define void @f4(i64 *%ptr1) {
46; CHECK-LABEL: f4:
47; CHECK: oc 8(8,%r2), 0(%r2)
48; CHECK: br %r14
49  %ptr2 = getelementptr i64, i64 *%ptr1, i64 1
50  %val = load i64 , i64 *%ptr1
51  %old = load i64 , i64 *%ptr2
52  %or = or i64 %old, %val
53  store i64 %or, i64 *%ptr2
54  ret void
55}
56
57; Leave other more complicated tests to and-08.ll.
58