[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/matrix.c

Reid Spencer reid at x10sys.com
Fri Jan 19 14:28:17 PST 2007



Changes in directory llvm-test/SingleSource/UnitTests/Integer:

matrix.c updated: 1.2 -> 1.3
---
Log message:

Rearrange code so sort definition comes before use and is not conflicting
with builtin sort function name.


---
Diffs of the changes:  (+42 -41)

 matrix.c |   83 +++++++++++++++++++++++++++++++--------------------------------
 1 files changed, 42 insertions(+), 41 deletions(-)


Index: llvm-test/SingleSource/UnitTests/Integer/matrix.c
diff -u llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.2 llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.3
--- llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.2	Thu Jan 18 20:48:16 2007
+++ llvm-test/SingleSource/UnitTests/Integer/matrix.c	Fri Jan 19 16:28:01 2007
@@ -2,9 +2,50 @@
 // Date: Fri Jan 12 17:32:33 CST 2007
 #include "matrix.h"
 #include <stdio.h>
+#include <stdlib.h>
 
 typedef enum bool{false=0, true=1} bool;
 
+// Thread: void mysort(const sc_int<17> X[8], sc_int<17> Y[8]);
+void mysort(const int17  X[8], int17  Y[8]){
+{
+  unsigned int i, j;
+  int17 temp;
+  {
+  j = 0;
+  for ( ; ; ) {
+  bool ssdm_tmp_4 = (j < 8);
+  if (!ssdm_tmp_4) break;
+    Y[j] = X[j];
+  j++;
+  }
+  }
+  {
+  j = 0;
+  for ( ; ; ) {
+  bool ssdm_tmp_5 = (j < 8);
+  if (!ssdm_tmp_5) break;
+    {
+      temp = -0xffff;
+      {
+      i = j;
+      for ( ; ; ) {
+      bool ssdm_tmp_6 = (i < 8);
+      if (!ssdm_tmp_6) break;
+        {
+          temp = Y[i] > temp ? Y[i] : temp;
+        }
+      ++i;
+      }
+      }
+      Y[j] = temp;
+    }
+  j++;
+  }
+  }
+}
+}
+
 // Module | Test
 // Thread: int my_test(sc_int<17> A[8][8], sc_int<17> B[8][8] );
 int my_test(int17  A[8][8], int17  B[8][8]){
@@ -32,7 +73,7 @@
         ++k;
         }
         }
-        sort(A[i], C);
+        mysort(A[i], C);
         t = get_gcd(C[0], C[1]);
         printf("t=%d\n", t);
       }
@@ -54,46 +95,6 @@
   return get_gcd( b, a % b );
 }
 }
-// Thread: void sort(const sc_int<17> X[8], sc_int<17> Y[8]);
-void sort(const int17  X[8], int17  Y[8]){
-{
-  unsigned int i, j;
-  int17 temp;
-  {
-  j = 0;
-  for ( ; ; ) {
-  bool ssdm_tmp_4 = (j < 8);
-  if (!ssdm_tmp_4) break;
-    Y[j] = X[j];
-  j++;
-  }
-  }
-  {
-  j = 0;
-  for ( ; ; ) {
-  bool ssdm_tmp_5 = (j < 8);
-  if (!ssdm_tmp_5) break;
-    {
-      temp = -0xffff;
-      {
-      i = j;
-      for ( ; ; ) {
-      bool ssdm_tmp_6 = (i < 8);
-      if (!ssdm_tmp_6) break;
-        {
-          temp = Y[i] > temp ? Y[i] : temp;
-        }
-      ++i;
-      }
-      }
-      Y[j] = temp;
-    }
-  j++;
-  }
-  }
-}
-}
-
 
 int main()
 {






More information about the llvm-commits mailing list