summaryrefslogtreecommitdiff
path: root/test/cminor
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2009-01-05 10:29:33 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2009-01-05 10:29:33 +0000
commitbd6a21e2e7c87725b9a1992e0179dae1009e7d40 (patch)
tree03e971052a0beed973b0183c986abdf6e2503a8a /test/cminor
parentbcc49e9df3e1885fcdf6e7a082f9101a323fb39c (diff)
Endianness in tests
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@939 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
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))