blob: 5709728642b4c89641c6a8d7d5f67be7e2864b0f [file] [log] [blame]
Benjamin Kramer258c7fa2009-10-12 09:31:55 +00001; RUN: llc -march=msp430 < %s | FileCheck %s
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +00002target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
3target triple = "msp430-generic-generic"
4
5@foo = common global i8 0, align 1
6@bar = common global i8 0, align 1
7
Anton Korobeynikov4b38ce92009-10-11 23:03:53 +00008define void @mov() nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +00009; CHECK-LABEL: mov:
Anton Korobeynikov4b38ce92009-10-11 23:03:53 +000010; CHECK: mov.b &bar, &foo
David Blaikiea79ac142015-02-27 21:17:42 +000011 %1 = load i8, i8* @bar
Anton Korobeynikov4b38ce92009-10-11 23:03:53 +000012 store i8 %1, i8* @foo
13 ret void
14}
15
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000016define void @add() nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000017; CHECK-LABEL: add:
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000018; CHECK: add.b &bar, &foo
David Blaikiea79ac142015-02-27 21:17:42 +000019 %1 = load i8, i8* @bar
20 %2 = load i8, i8* @foo
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000021 %3 = add i8 %2, %1
22 store i8 %3, i8* @foo
23 ret void
24}
25
26define void @and() nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000027; CHECK-LABEL: and:
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000028; CHECK: and.b &bar, &foo
David Blaikiea79ac142015-02-27 21:17:42 +000029 %1 = load i8, i8* @bar
30 %2 = load i8, i8* @foo
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000031 %3 = and i8 %2, %1
32 store i8 %3, i8* @foo
33 ret void
34}
35
36define void @bis() nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000037; CHECK-LABEL: bis:
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000038; CHECK: bis.b &bar, &foo
David Blaikiea79ac142015-02-27 21:17:42 +000039 %1 = load i8, i8* @bar
40 %2 = load i8, i8* @foo
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000041 %3 = or i8 %2, %1
42 store i8 %3, i8* @foo
43 ret void
44}
45
46define void @xor() nounwind {
Stephen Lind24ab202013-07-14 06:24:09 +000047; CHECK-LABEL: xor:
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000048; CHECK: xor.b &bar, &foo
David Blaikiea79ac142015-02-27 21:17:42 +000049 %1 = load i8, i8* @bar
50 %2 = load i8, i8* @foo
Anton Korobeynikov415c3dc2009-10-11 23:03:28 +000051 %3 = xor i8 %2, %1
52 store i8 %3, i8* @foo
53 ret void
54}
55
Anton Korobeynikov29ffb6d2019-01-10 22:54:53 +000056define void @cmp(i8* %g, i8* %i) {
57entry:
58; CHECK-LABEL: cmp:
59; CHECK: cmp.b 4(r12), 2(r13)
60 %add.ptr = getelementptr inbounds i8, i8* %g, i16 4
61 %0 = load i8, i8* %add.ptr, align 1
62 %add.ptr1 = getelementptr inbounds i8, i8* %i, i16 2
63 %1 = load i8, i8* %add.ptr1, align 1
64 %cmp = icmp sgt i8 %0, %1
65 br i1 %cmp, label %if.then, label %if.end
66
67if.then: ; preds = %entry
68 store i8 0, i8* %g, align 2
69 br label %if.end
70
71if.end: ; preds = %if.then, %entry
72 ret void
73}