[test-suite] r176549 - Force signed char on McCat to pass on ARM

Renato Golin renato.golin at linaro.org
Wed Mar 6 02:05:32 PST 2013


Author: rengolin
Date: Wed Mar  6 04:05:32 2013
New Revision: 176549

URL: http://llvm.org/viewvc/llvm-project?rev=176549&view=rev
Log:
Force signed char on McCat to pass on ARM

Modified:
    test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtest.c
    test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtest.h
    test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestA.c
    test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestB.c
    test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestC.c

Modified: test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtest.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtest.c?rev=176549&r1=176548&r2=176549&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtest.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtest.c Wed Mar  6 04:05:32 2013
@@ -18,7 +18,7 @@
 
 #define IOTEST_SIZE (53681*50) /* prime number */ /* 53681 19170419 67108933 */
 
-char *testarray;
+char_t *testarray;
 unsigned long array_count;
 
 unsigned long getac(void)
@@ -46,27 +46,27 @@ void initarray(void)
     }
 }
 
-char array(unsigned long i)
+char_t array(unsigned long i)
 {
   return testarray[i];
 }
 
-char min(char a, char b)
+char_t min(char_t a, char_t b)
 {
   return (a>b)? a : b ;
 }
 
-char max(char a, char b)
+char_t max(char_t a, char_t b)
 {
   return (a>b) ? b : a ;
 }
 
-char add(char a, char b)
+char_t add(char_t a, char_t b)
 {
   return a+b;
 }
 
-char mult(char a, char b)
+char_t mult(char_t a, char_t b)
 {
   return a*b;
 }
@@ -86,7 +86,7 @@ void loop( void (*init)(void *) , void (
 
 extern void testA(void), testB(void), testC(void);
 int main() {
-	testarray = (char*)malloc(IOTEST_SIZE);
+	testarray = (char_t*)malloc(IOTEST_SIZE);
 	testA(); testB(); testC();
 	return 0;
 }

Modified: test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtest.h
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtest.h?rev=176549&r1=176548&r2=176549&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtest.h (original)
+++ test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtest.h Wed Mar  6 04:05:32 2013
@@ -1,28 +1,31 @@
 
+/* Some archs (ARM) default to unsigned char
+   and test results assumes signed */
+typedef signed char char_t;
 
 struct global_result
 {
-  char min;
-  char max;
-  char add;
-  char mult;
+  char_t min;
+  char_t max;
+  char_t add;
+  char_t mult;
 };
 
 void initarray(void);
 
-char array(unsigned long i);
+char_t array(unsigned long i);
 
 unsigned long getac(void);
 
 void setac(unsigned long i);
 
-char min(char a, char b);
+char_t min(char_t a, char_t b);
 
-char max(char a, char b);
+char_t max(char_t a, char_t b);
 
-char add(char a, char b);
+char_t add(char_t a, char_t b);
 
-char mult(char a, char b);
+char_t mult(char_t a, char_t b);
 
 void loop(void (*init)(void *) , void (*step)(void *) ,void *result);
 

Modified: test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestA.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestA.c?rev=176549&r1=176548&r2=176549&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestA.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestA.c Wed Mar  6 04:05:32 2013
@@ -29,7 +29,7 @@ void initA(struct global_result *res)
 
 void stepA(struct global_result *res)
 {
-  register char t;
+  register char_t t;
   unsigned long i;
   t=array(getac());
   res->min=min(res->min,t);

Modified: test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestB.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestB.c?rev=176549&r1=176548&r2=176549&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestB.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestB.c Wed Mar  6 04:05:32 2013
@@ -18,36 +18,36 @@
 
 /* slow version */
 
-void initminB(char *res)
+void initminB(char_t *res)
 {
   setac(0);
   *res=255;
 }
 
-void initmaxB(char *res)
+void initmaxB(char_t *res)
 {
   setac(0);
   *res=0;
 }
 
-void initaddB(char *res)
+void initaddB(char_t *res)
 {
   setac(0);
   *res=0;
 }
 
-void initmultB(char *res)
+void initmultB(char_t *res)
 {
   setac(0);
   *res=1;
 }
 
 
-void stepminB(char *res)
+void stepminB(char_t *res)
 /* {{{  */
 
 {
-  register char t;
+  register char_t t;
   unsigned long i;
   t=array(getac());
   *res=min(*res,t);
@@ -57,10 +57,10 @@ void stepminB(char *res)
 
 /* }}} */
 
-void stepmaxB(char *res)
+void stepmaxB(char_t *res)
 /* {{{  */
 {
-  register char t;
+  register char_t t;
   unsigned long i;
   t=array(getac());
   *res=max(*res,t);
@@ -69,10 +69,10 @@ void stepmaxB(char *res)
 }
 /* }}} */
 
-void stepaddB(char *res)
+void stepaddB(char_t *res)
 /* {{{  */
 {
-  register char t;
+  register char_t t;
   unsigned long i;
   t=array(getac());
   *res=add(*res,t);
@@ -81,11 +81,11 @@ void stepaddB(char *res)
 }
 /* }}} */
 
-void stepmultB(char *res)
+void stepmultB(char_t *res)
 /* {{{  */
 
 {
-  register char t;
+  register char_t t;
   unsigned long i;
   t=array(getac());
   *res=mult(*res,t);

Modified: test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestC.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestC.c?rev=176549&r1=176548&r2=176549&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestC.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/McCat/12-IOtest/IOtestC.c Wed Mar  6 04:05:32 2013
@@ -18,36 +18,36 @@
 
 /* slow version */
 
-static void initminB(char *res)
+static void initminB(char_t *res)
 {
   setac(0);
   *res=255;
 }
 
-static void initmaxB(char *res)
+static void initmaxB(char_t *res)
 {
   setac(0);
   *res=0;
 }
 
-static void initaddB(char *res)
+static void initaddB(char_t *res)
 {
   setac(0);
   *res=0;
 }
 
-static void initmultB(char *res)
+static void initmultB(char_t *res)
 {
   setac(0);
   *res=1;
 }
 
 
-static void stepminB(char *res)
+static void stepminB(char_t *res)
 /* {{{  */
 
 {
-  register char t;
+  register char_t t;
   unsigned long i;
   t=array(getac());
   *res=min(*res,t);
@@ -57,10 +57,10 @@ static void stepminB(char *res)
 
 /* }}} */
 
-static void stepmaxB(char *res)
+static void stepmaxB(char_t *res)
 /* {{{  */
 {
-  register char t;
+  register char_t t;
   unsigned long i;
   t=array(getac());
   *res=max(*res,t);
@@ -69,10 +69,10 @@ static void stepmaxB(char *res)
 }
 /* }}} */
 
-static void stepaddB(char *res)
+static void stepaddB(char_t *res)
 /* {{{  */
 {
-  register char t;
+  register char_t t;
   unsigned long i;
   t=array(getac());
   *res=add(*res,t);
@@ -81,11 +81,11 @@ static void stepaddB(char *res)
 }
 /* }}} */
 
-static void stepmultB(char *res)
+static void stepmultB(char_t *res)
 /* {{{  */
 
 {
-  register char t;
+  register char_t t;
   unsigned long i;
   t=array(getac());
   *res=mult(*res,t);





More information about the llvm-commits mailing list