aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>2000-03-29 20:48:06 +0000
committerJeff Law <law@gcc.gnu.org>2000-03-29 13:48:06 -0700
commit843cae51d5a9894021659be3444a4120d1eb224c (patch)
tree2ffc4ce265468a916e39c08d94797759e622be2b
parent700473ab02b3fdd6c4c8d0fa4fcbc218116d7146 (diff)
downloadgcc-843cae51d5a9894021659be3444a4120d1eb224c.zip
gcc-843cae51d5a9894021659be3444a4120d1eb224c.tar.gz
gcc-843cae51d5a9894021659be3444a4120d1eb224c.tar.bz2
* gcc.c-torture/compile/20000329-1.c: New test.
From-SVN: r32815
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20000329-1.c40
2 files changed, 44 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 163776a..b368cc3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+Wed Mar 29 13:44:23 2000 Jeffrey A Law (law@cygnus.com)
+
+ * gcc.c-torture/compile/20000329-1.c: New test.
+
2000-03-23 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.ext/array4.C: New test.
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 0000000..547bf96
--- /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);
+}