Moved *.c files into subdirectory TestSources to avoid overwriting
authorVikram S. Adve <vadve@cs.uiuc.edu>
Tue, 6 Nov 2001 17:06:06 +0000 (17:06 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Tue, 6 Nov 2001 17:06:06 +0000 (17:06 +0000)
corresponding *.ll files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1155 91177308-0d34-0410-b5e6-96231b3b80d8

test/ackermann.c [deleted file]
test/array.c [deleted file]
test/ary3.c [deleted file]
test/combinations.c [deleted file]
test/fib2.c [deleted file]
test/heapsort.c [deleted file]
test/testmisc.c [deleted file]

diff --git a/test/ackermann.c b/test/ackermann.c
deleted file mode 100644 (file)
index 5e1bd48..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- mode: c -*-
- * $Id$
- * http://www.bagley.org/~doug/shootout/
- */
-
-int printf(const char *, int, int);
-int atoi(const char *);
-
-int 
-Ack(int M, int N) {
-    if (M == 0) return( N + 1 );
-    if (N == 0) return( Ack(M - 1, 1) );
-    return( Ack(M - 1, Ack(M, (N - 1))) );
-}
-
-int
-main(int argc, char *argv[]) {
-    int n = ((argc == 2) ? atoi(argv[1]) : 5);
-
-    printf("Ack(3,%d): %d\n", n, Ack(3, n));
-    return(0);
-}
-
diff --git a/test/array.c b/test/array.c
deleted file mode 100644 (file)
index c24321e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-extern printf(const char *, double, double);
-
-int
-checkIdxCode(int N, int* A, float F[][30])
-{
-  int i, j;
-  float sumA=0.0, sumF=0.0;
-  for (i=0; i < 12; i++)
-    {
-      sumA = sumA + A[i];
-      for (j=0; j < 10; j++)
-       {
-         F[i][j] = 0.5 * (F[i][j-1] + F[i-1][j]);
-         sumF = sumF + F[i][j];
-       }
-    }
-  printf("sumA = %lf, sumF = %lf\n", sumA, sumF);
-}
-
-#if 0
-int
-main(int argc, char** argv)
-{
-  int  N = argc+20;
-  int* A = (int*) malloc(N * sizeof(int));
-  float F[25][30];
-  return checkIdxCode(N, A, F);
-}
-
-#endif
diff --git a/test/ary3.c b/test/ary3.c
deleted file mode 100644 (file)
index 3bb99f9..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- mode: c -*-
- * $Id$
- * http://www.bagley.org/~doug/shootout/
- *
- * this program is modified from:
- *   http://cm.bell-labs.com/cm/cs/who/bwk/interps/pap.html
- * Timing Trials, or, the Trials of Timing: Experiments with Scripting
- * and User-Interface Languages</a> by Brian W. Kernighan and
- * Christopher J. Van Wyk.
- *
- * I added free() to deallocate memory.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main(int argc, char *argv[]) {
-    int n = ((argc == 2) ? atoi(argv[1]) : 1);
-    int i, k, *x, *y;
-       
-    x = (int *) calloc(n, sizeof(int));
-    y = (int *) calloc(n, sizeof(int));
-
-    for (i = 0; i < n; i++) {
-       x[i] = i + 1;
-    }
-    for (k=0; k<1000; k++) {
-       for (i = n-1; i >= 0; i--) {
-           y[i] += x[i];
-       }
-    }
-
-    printf("%d %d\n", y[0], y[n-1]);
-
-    free(x);
-    free(y);
-
-    return(0);
-}
-
diff --git a/test/combinations.c b/test/combinations.c
deleted file mode 100644 (file)
index cffdff1..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-void combinations(unsigned int n, unsigned *A) {
-  unsigned int i, t = 1;
-  A[0] = A[n] = 1;
-
-  for (i = 1; i <= n/2; i++) {
-    t = (t * (n+1-i)) / i;
-    A[i] = A[n-i] = t;
-  }
-}
diff --git a/test/fib2.c b/test/fib2.c
deleted file mode 100644 (file)
index 7ce545e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- mode: c -*-
- * $Id$
- * http://www.bagley.org/~doug/shootout/
- */
-
-int atoi(char *);
-void printf(char *, unsigned long);
-
-unsigned long
-fib(unsigned long n) {
-    if (n < 2)
-       return(1);
-    else
-       return(fib(n-2) + fib(n-1));
-}
-
-int
-main(int argc, char *argv[]) {
-    int N = ((argc == 2) ? atoi(argv[1]) : 15);
-    printf("%ld\n", fib(N));
-    return(0);
-}
diff --git a/test/heapsort.c b/test/heapsort.c
deleted file mode 100644 (file)
index 17c1185..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- mode: c -*-
- * $Id$
- * http://www.bagley.org/~doug/shootout/
- */
-
-#include <stdlib.h>
-#include <math.h>
-#include <stdio.h>
-
-#define IM 139968
-#define IA   3877
-#define IC  29573
-
-double
-gen_random(double max) {
-    static long last = 42;
-    return( max * (last = (last * IA + IC) % IM) / IM );
-}
-
-void
-heapsort(int n, double *ra) {
-    int i, j;
-    int ir = n;
-    int l = (n >> 1) + 1;
-    double rra;
-
-    for (;;) {
-       if (l > 1) {
-           rra = ra[--l];
-       } else {
-            rra = ra[ir];
-           ra[ir] = ra[1];
-           if (--ir == 1) {
-               ra[1] = rra;
-               return;
-           }
-       }
-
-       i = l;
-       j = l << 1;
-       while (j <= ir) {
-           if (j < ir && ra[j] < ra[j+1]) { 
-              ++j; 
-            }
-           if (rra < ra[j]) {
-               ra[i] = ra[j];
-               j += (i = j);
-           } else {
-               j = ir + 1;
-           }
-       }
-       ra[i] = rra;
-    }
-}
-
-int
-main(int argc, char *argv[]) {
-    int N = ((argc == 2) ? atoi(argv[1]) : 10);
-    double *ary;
-    int i;
-    
-    /* create an array of N random doubles */
-    ary = (double *)malloc((N+1) * sizeof(double));
-    for (i=1; i<=N; i++) {
-       ary[i] = gen_random(1);
-    }
-
-    heapsort(N, ary);
-
-    printf("%f\n", ary[N]);
-
-    free(ary);
-    return(0);
-}
-
diff --git a/test/testmisc.c b/test/testmisc.c
deleted file mode 100644 (file)
index 8089037..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-void *malloc(unsigned);
-void foundIt(void);
-
-typedef struct list {
-  struct list *Next;
-  int Data;
-} list;
-
-extern list ListNode1;
-list ListNode3 = { 0, 4 };
-list ListNode2 = { &ListNode3, 3 };
-list ListNode0 = { &ListNode1, 1 };
-list ListNode1 = { &ListNode2, 2 };
-
-int *ListDataPtr = &ListNode3.Data;
-
-list ListArray[10];
-
-/*
-   TODO: When we have getelementptr on globals
-list *ListArrElement  = ListArray+4;
-list *ListArrElement2 = &ListArray[5];
-*/
-
-// Iterative insert fn
-void InsertIntoListTail(list **L, int Data) {
-  while (*L)
-    L = &(*L)->Next;
-  *L = (list*)malloc(sizeof(list));
-  (*L)->Data = Data;
-  (*L)->Next = 0;
-}
-
-// Recursive list search fn
-list *FindData(list *L, int Data) {
-  if (L == 0) return 0;
-  if (L->Data == Data) return L;
-  return FindData(L->Next, Data);
-}
-
-// Driver fn...
-void DoListStuff() {
-  list *MyList = 0;
-  InsertIntoListTail(&MyList, 100);
-  InsertIntoListTail(&MyList, 12);
-  InsertIntoListTail(&MyList, 42);
-  InsertIntoListTail(&MyList, 1123);
-  InsertIntoListTail(&MyList, 1213);
-
-  if (FindData(MyList, 75)) foundIt();
-  if (FindData(MyList, 42)) foundIt();
-  if (FindData(MyList, 700)) foundIt();
-}
-
-
-//#include <stdio.h>
-int puts(const char *s);
-
-struct FunStructTest {
-  int Test1;
-  char *Pointer;
-  int Array[12];
-};
-
-struct SubStruct {
-  short X, Y;
-};
-
-struct Quad {
-  int w;
-  struct SubStruct SS;
-  struct SubStruct *SSP;
-  char c;
-  int y;
-}; 
-
-struct Quad GlobalQuad = { 4, {1, 2}, 0, 3, 156 };
-
-typedef int (*FuncPtr)(int);
-
-#if 0
-unsigned PtrFunc(int (*Func)(int), int X) {
-  return Func(X);
-}
-
-char PtrFunc2(FuncPtr FuncTab[30], int Num) {
-  return FuncTab[Num]('b');
-}
-
-extern char SmallArgs2(char w, char x, long long Zrrk, char y, char z);
-extern int SomeFunc(void);
-char SmallArgs(char w, char x, char y, char z) {
-  SomeFunc();
-  return SmallArgs2(w-1, x+1, y, z, w);
-}
-#endif
-
-#if 1
-int F0(struct Quad Q, int i) {              /* Pass Q by value */
-  struct Quad R;
-  if (i) R.SS = Q.SS;
-  //Q.SSP = &R.SS;
-  Q.w = Q.y = Q.c = 1;
-  return Q.SS.Y + i + R.y - Q.c;
-}
-
-int F1(struct Quad *Q, int i) {             /* Pass Q by address */
-  struct Quad R;
-#if 0
-  if (i) R.SS = Q->SS;
-#else
-  if (i) R = *Q;
-#endif
-  Q->w = Q->y = Q->c = 1;
-  return Q->SS.Y+i+R.y-Q->c;
-}
-#endif
-
-
-int BadFunc(float Val) {
-  int Result; 
-#if BROKEN_PHIS
-  if (Val > 12.345) Result = 4;
-#endif
-  return Result;     /* Test use of undefined value */
-}
-
-#if USE_UNDEFINED
-int RealFunc(void) {
-  return SomeUndefinedFunction(1, 4, 5);
-}
-#endif
-
-extern int EF1(int *, char *, int *);
-
-int Func(int Param, long long Param2) {
-  int Result = Param;
-
-  {{{{
-    char c; int X;
-    EF1(&Result, &c, &X);
-  }}}}
-  return Result;
-}
-
-
-short FunFunc(long long x, char z) {
-  return x+z;
-}
-
-unsigned castTest(int X) { return X; }
-
-double TestAdd(double X, float Y) {
-  return X+Y+.5;
-}
-
-int func(int i, int j) {
-  while (i != 20)
-    i += 2;
-
-  j += func(2, i);
-  return (i * 3 + j*2)*j;
-}
-
-int SumArray(int Array[], int Num) {
-  int i, Result = 0;
-  for (i = 0; i < Num; ++i)
-    Result += Array[i];
-
-  return Result;
-}
-
-int ArrayParam(int Values[100]) {
-  return EF1((int*)Values[50], 0, &Values[50]);
-}
-
-int ArrayToSum(void) {
-  int A[100], i;
-  for (i = 0; i < 100; ++i)
-    A[i] = i*4;
-
-  return A[A[0]]; //SumArray(A, 100);  
-}
-
-int ExternFunc(long long, unsigned*, short, unsigned char);
-
-int main(int argc, char *argv[]) {
-  unsigned i;
-
-  ExternFunc(-1, 0, (short)argc, 2);
-  //func(argc, argc);
-  
-  for (i = 0; i < 10; i++)
-    puts(argv[3]);//"Hello world");
-  return 0;
-}
-
-double MathFunc(double X, double Y, double Z,
-              double AA, double BB, double CC, double DD,
-              double EE, double FF, double GG, double HH,
-              double aAA, double aBB, double aCC, double aDD,
-              double aEE, double aFF) {
-  return X + Y + Z + AA + BB + CC + DD + EE + FF + GG + HH
-       + aAA + aBB + aCC + aDD + aEE + aFF;
-}
-
-
-
-void strcpy(char *s1, char *s2) {
-    while (*s1++ = *s2++);
-}
-
-void strcat(char *s1, char *s2) {
-    while (*s1++);
-    s1--;
-    while (*s1++ = *s2++);
-}
-
-int strcmp(char *s1, char *s2) {
-    while (*s1++ == *s2++);
-    if (*s1 == 0) {
-       if (*s2 == 0) {
-           return 0;
-       } else {
-           return -1;
-       }
-    } else {
-       if (*s2 == 0) {
-           return 1;
-       } else {
-           return (*(--s1) - *(--s2));
-       }
-    }
-}