summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/20000329-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/20000329-1.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20000329-1.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/20000329-1.c b/gcc/testsuite/gcc.c-torture/compile/20000329-1.c
new file mode 100644
index 000000000..547bf96f9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20000329-1.c
@@ -0,0 +1,40 @@
+int giop_tx_big_endian;
+
+inline
+void
+giop_encode_ulong (unsigned long i, char *buf)
+{
+ if (giop_tx_big_endian)
+ {
+ *(unsigned long *) buf = i;
+ }
+ else
+ {
+ *buf++ = i & 0xff;
+ *buf++ = (i >> 8) & 0xff;
+ *buf++ = (i >> 16) & 0xff;
+ *buf = (i >> 24) & 0xff;
+ }
+}
+
+
+
+static
+double
+time_giop_encode (unsigned long l)
+{
+ int c;
+ char buf[4];
+
+ for (c = 0; c < (512 * 1024 * 1024); ++c)
+ {
+ giop_encode_ulong (l, buf);
+ }
+}
+
+int
+main (int ac, char *av[])
+{
+ giop_tx_big_endian = 1;
+ time_giop_encode (0);
+}