summaryrefslogtreecommitdiff
path: root/test/cminor
diff options
context:
space:
mode:
Diffstat (limited to 'test/cminor')
-rw-r--r--test/cminor/aes.cmp12
-rw-r--r--test/cminor/sha1.cmp6
2 files changed, 18 insertions, 0 deletions
diff --git a/test/cminor/aes.cmp b/test/cminor/aes.cmp
index 11a253c..510e59f 100644
--- a/test/cminor/aes.cmp
+++ b/test/cminor/aes.cmp
@@ -1,7 +1,19 @@
/* AES cipher. To be preprocessed with cpp -P. */
+#if defined(__ppc__) || defined(__PPC__)
+#define ARCH_BIG_ENDIAN
+#elif defined(__i386__) || defined(__x86_64__) || defined(__ARMEL__)
+#undef ARCH_BIG_ENDIAN
+#else
+#error "unknown endianness"
+#endif
+
+#ifdef ARCH_BIG_ENDIAN
#define GETU32(pt) int32[pt]
#define PUTU32(ct,st) int32[ct] = st
+#else
+#error "this test is not available yet in little-endian"
+#endif
#define rk(n) int32[rk_ + (n) * 4]
#define Te0(n) int32["Te0" + (n) * 4]
diff --git a/test/cminor/sha1.cmp b/test/cminor/sha1.cmp
index 9d7744c..98a6b51 100644
--- a/test/cminor/sha1.cmp
+++ b/test/cminor/sha1.cmp
@@ -6,7 +6,13 @@
extern "memcpy" : int -> int -> int -> void
extern "memset" : int -> int -> int -> void
+#if defined(__ppc__) || defined(__PPC__)
#define ARCH_BIG_ENDIAN
+#elif defined(__i386__) || defined(__x86_64__) || defined(__ARMEL__)
+#undef ARCH_BIG_ENDIAN
+#else
+#error "unknown endianness"
+#endif
#define rol1(x) (((x) << 1) | ((x) >>u 31))
#define rol5(x) (((x) << 5) | ((x) >>u 27))