aboutsummaryrefslogtreecommitdiff
path: root/tests/tests2
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tests2')
-rw-r--r--tests/tests2/73_arm64.c83
-rw-r--r--tests/tests2/73_arm64.expect36
2 files changed, 119 insertions, 0 deletions
diff --git a/tests/tests2/73_arm64.c b/tests/tests2/73_arm64.c
index 21a2462..8de61b3 100644
--- a/tests/tests2/73_arm64.c
+++ b/tests/tests2/73_arm64.c
@@ -2,6 +2,7 @@
// calling convention, but should give the same results on any architecture.
#include <stdarg.h>
+#include <stdint.h>
#include <stdio.h>
struct s1 { char x[1]; } s1 = { "0" };
@@ -429,12 +430,94 @@ void movi(void)
pll(0xabcdef0123456789);
}
+static uint32_t addip0(uint32_t x) { return x + 0; }
+static uint64_t sublp0(uint64_t x) { return x - 0; }
+static uint32_t addip123(uint32_t x) { return x + 123; }
+static uint64_t addlm123(uint64_t x) { return x + -123; }
+static uint64_t sublp4095(uint64_t x) { return x - 4095; }
+static uint32_t subim503808(uint32_t x) { return x - -503808; }
+static uint64_t addp12345(uint64_t x) { return x + 12345; }
+static uint32_t subp12345(uint32_t x) { return x - 12345; }
+
+static uint32_t mvni(uint32_t x) { return 0xffffffff - x; }
+static uint64_t negl(uint64_t x) { return 0 - x; }
+static uint32_t rsbi123(uint32_t x) { return 123 - x; }
+static uint64_t rsbl123(uint64_t x) { return 123 - x; }
+
+static uint32_t andi0(uint32_t x) { return x & 0; }
+static uint64_t andlm1(uint64_t x) { return x & -1; }
+static uint64_t orrl0(uint64_t x) { return x | 0; }
+static uint32_t orrim1(uint32_t x) { return x | -1; }
+static uint32_t eori0(uint32_t x) { return x ^ 0; }
+static uint64_t eorlm1(uint64_t x) { return x ^ -1; }
+static uint32_t and0xf0(uint32_t x) { return x & 0xf0; }
+static uint64_t orr0xf0(uint64_t x) { return x | 0xf0; }
+static uint64_t eor0xf0(uint64_t x) { return x ^ 0xf0; }
+
+static uint32_t lsli0(uint32_t x) { return x << 0; }
+static uint32_t lsri0(uint32_t x) { return x >> 0; }
+static int64_t asrl0(int64_t x) { return x >> 0; }
+static uint32_t lsli1(uint32_t x) { return x << 1; }
+static uint32_t lsli31(uint32_t x) { return x << 31; }
+static uint64_t lsll1(uint64_t x) { return x << 1; }
+static uint64_t lsll63(uint64_t x) { return x << 63; }
+static uint32_t lsri1(uint32_t x) { return x >> 1; }
+static uint32_t lsri31(uint32_t x) { return x >> 31; }
+static uint64_t lsrl1(uint64_t x) { return x >> 1; }
+static uint64_t lsrl63(uint64_t x) { return x >> 63; }
+static int32_t asri1(int32_t x) { return x >> 1; }
+static int32_t asri31(int32_t x) { return x >> 31; }
+static int64_t asrl1(int64_t x) { return x >> 1; }
+static int64_t asrl63(int64_t x) { return x >> 63; }
+
+void opi(void)
+{
+ int x = 1000;
+ pll(addip0(x));
+ pll(sublp0(x));
+ pll(addip123(x));
+ pll(addlm123(x));
+ pll(sublp4095(x));
+ pll(subim503808(x));
+ pll(addp12345(x));
+ pll(subp12345(x));
+ pll(mvni(x));
+ pll(negl(x));
+ pll(rsbi123(x));
+ pll(rsbl123(x));
+ pll(andi0(x));
+ pll(andlm1(x));
+ pll(orrl0(x));
+ pll(orrim1(x));
+ pll(eori0(x));
+ pll(eorlm1(x));
+ pll(and0xf0(x));
+ pll(orr0xf0(x));
+ pll(eor0xf0(x));
+ pll(lsli0(x));
+ pll(lsri0(x));
+ pll(asrl0(x));
+ pll(lsli1(x));
+ pll(lsli31(x));
+ pll(lsll1(x));
+ pll(lsll63(x));
+ pll(lsri1(x));
+ pll(lsri31(x));
+ pll(lsrl1(x));
+ pll(lsrl63(x));
+ pll(asri1(x));
+ pll(asri31(x));
+ pll(asrl1(x));
+ pll(asrl63(x));
+}
+
void pcs(void)
{
arg();
ret();
stdarg();
movi();
+ opi();
}
int main()
diff --git a/tests/tests2/73_arm64.expect b/tests/tests2/73_arm64.expect
index 00e5529..7bdebd3 100644
--- a/tests/tests2/73_arm64.expect
+++ b/tests/tests2/73_arm64.expect
@@ -136,3 +136,39 @@ abcd1234ffffffff
ffffef0123456789
abcdef012345ffff
abcdef0123456789
+3e8
+3e8
+463
+36d
+fffffffffffff3e9
+7b3e8
+3421
+ffffd3af
+fffffc17
+fffffffffffffc18
+fffffc93
+fffffffffffffc93
+0
+3e8
+3e8
+ffffffff
+3e8
+fffffffffffffc17
+e0
+3f8
+318
+3e8
+3e8
+3e8
+7d0
+0
+7d0
+0
+1f4
+0
+1f4
+0
+1f4
+0
+1f4
+0