Put it back!
authorVikram S. Adve <vadve@cs.uiuc.edu>
Mon, 5 Nov 2001 00:48:27 +0000 (00:48 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Mon, 5 Nov 2001 00:48:27 +0000 (00:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1136 91177308-0d34-0410-b5e6-96231b3b80d8

test/runtime.c [new file with mode: 0644]

diff --git a/test/runtime.c b/test/runtime.c
new file mode 100644 (file)
index 0000000..2ff7c0a
--- /dev/null
@@ -0,0 +1,99 @@
+#include <stdio.h>
+#include <sys/types.h>
+
+void
+printSByte(char c)
+{
+  putchar(c);
+}
+
+void
+printUByte(unsigned char c)
+{
+  putchar(c);
+}
+
+void
+printShort(short i)
+{
+  printf("%d", i);
+}
+
+void
+printUShort(unsigned short i)
+{
+  printf("%d", i);
+}
+
+void
+printInt(int i)
+{
+  printf("%d", i);
+}
+
+void
+printUInt(unsigned int i)
+{
+  printf("%d", i);
+}
+
+void
+printLong(int64_t l)
+{
+  printf("%d", l);
+}
+
+void
+printULong(uint64_t l)
+{
+  printf("%d", l);
+}
+
+void
+printString(const char* str)
+{
+  printf("%s", str);
+}
+
+void
+printFloat(float f)
+{
+  printf("%g", f);
+}
+
+void
+printDouble(double d)
+{
+  printf("%g", d);
+}
+
+void
+printPointer(void* p)
+{
+  printf("0x%x", p);
+}
+
+#undef  TEST_RUNTIME
+#ifdef  TEST_RUNTIME
+int
+main(int argc, char** argv)
+{
+  int i;
+  printString("argc = ");
+  printLong(argc);
+  printString(" = (as float) ");
+  printFloat(argc * 1.0);
+  printString(" = (as double) ");
+  printDouble(argc * 1.0);
+  for (i=0; i < argc; i++)
+    {
+      printString("\nargv[");
+      printLong(i);
+      printString("] = ");
+      printString(argv[i]);
+      printString("\t@ ");
+      printPointer(argv[i]);
+    }
+  printString("\n");
+}
+#endif