aboutsummaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.lang/BuiltinReverseBytes.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/testsuite/libjava.lang/BuiltinReverseBytes.java')
-rw-r--r--libjava/testsuite/libjava.lang/BuiltinReverseBytes.java62
1 files changed, 0 insertions, 62 deletions
diff --git a/libjava/testsuite/libjava.lang/BuiltinReverseBytes.java b/libjava/testsuite/libjava.lang/BuiltinReverseBytes.java
deleted file mode 100644
index 0d2e332..0000000
--- a/libjava/testsuite/libjava.lang/BuiltinReverseBytes.java
+++ /dev/null
@@ -1,62 +0,0 @@
-class BuiltinReverseBytes
-{
- public static short bswap16(short x)
- {
- return Short.reverseBytes(x);
- }
-
- public static int bswap32(int x)
- {
- return Integer.reverseBytes(x);
- }
-
- public static long bswap64(long x)
- {
- return Long.reverseBytes(x);
- }
-
- public static void main(String[] args)
- {
- if (Short.reverseBytes((short)0) != (short)0)
- throw new Error();
- if (Short.reverseBytes((short)0x1234) != (short)0x3412)
- throw new Error();
- if (Short.reverseBytes((short)-1) != (short)-1)
- throw new Error();
-
- if (Integer.reverseBytes(0) != 0)
- throw new Error();
- if (Integer.reverseBytes(0x12345678) != 0x78563412)
- throw new Error();
- if (Integer.reverseBytes(-1) != -1)
- throw new Error();
-
- if (Long.reverseBytes(0L) != 0L)
- throw new Error();
- if (Long.reverseBytes(0x123456789abcde0fL) != 0x0fdebc9a78563412L)
- throw new Error();
- if (Long.reverseBytes(-1L) != -1L)
- throw new Error();
-
- if (bswap16((short)0) != (short)0)
- throw new Error();
- if (bswap16((short)0x1234) != (short)0x3412)
- throw new Error();
- if (bswap16((short)-1) != (short)-1)
- throw new Error();
-
- if (bswap32(0) != 0)
- throw new Error();
- if (bswap32(0x12345678) != 0x78563412)
- throw new Error();
- if (bswap32(-1) != -1)
- throw new Error();
-
- if (bswap64(0L) != 0L)
- throw new Error();
- if (bswap64(0x123456789abcde0fL) != 0x0fdebc9a78563412L)
- throw new Error();
- if (bswap64(-1L) != -1L)
- throw new Error();
- }
-}