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

Zhou Sheng zhousheng00 at gmail.com
Thu May 31 03:25:22 PDT 2007



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

reduce_xor.c added (r1.1)
reduce_xor.reference_output added (r1.1)
---
Log message:

Add a new test case for reduce_xor


---
Diffs of the changes:  (+121 -0)

 reduce_xor.c                |   41 ++++++++++++++++++++++
 reduce_xor.reference_output |   80 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 121 insertions(+)


Index: llvm-test/SingleSource/UnitTests/Integer/reduce_xor.c
diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/reduce_xor.c:1.1
*** /dev/null	Thu May 31 05:25:14 2007
--- llvm-test/SingleSource/UnitTests/Integer/reduce_xor.c	Thu May 31 05:25:04 2007
***************
*** 0 ****
--- 1,41 ----
+ #include "bits.h"
+ #include <stdio.h>
+ 
+ int test_reduce_xor47(uint47 x)
+ {
+   unsigned result = reduce(xor, x) != 0;
+   printf("reduce_xor47(x) = %d\n", result);
+   return result;
+ }  
+ 
+ int test_reduce_xor68(uint68 x)
+ {
+   unsigned result = reduce(xor, x) != 0;
+   printf("reduce_xor68(x) = %d\n", result);
+   return result;
+ }  
+ 
+ int test_reduce_xor250(uint250 x)
+ {
+   unsigned result = reduce(xor, x) != 0;
+   printf("reduce_xor250(x) = %d\n", result);
+   return result;
+ }  
+ 
+ int main(int argc, char** argv) {
+   uint250 x = 0xF0F0F0F0F0F0F0F0ULL;
+   int result = 0;
+   int i;
+   srand(128);
+   for (i = 0; i < 16; ++i) {
+     x *= rand();
+     printf("x = 0b0");
+     printBits(x);
+     printf("\n");
+     result = 
+       test_reduce_xor47(x)  + test_reduce_xor68(x) +
+       test_reduce_xor250(x);
+     printf("Xor reductions of x = %d\n", result);
+   }
+   return 0;
+ }


Index: llvm-test/SingleSource/UnitTests/Integer/reduce_xor.reference_output
diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/reduce_xor.reference_output:1.1
*** /dev/null	Thu May 31 05:25:22 2007
--- llvm-test/SingleSource/UnitTests/Integer/reduce_xor.reference_output	Thu May 31 05:25:04 2007
***************
*** 0 ****
--- 1,80 ----
+ x = 0b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100110100001001000110010100101101001011010010110100101101000101111111100100001000110010000
+ reduce_xor47(x) = 0
+ reduce_xor68(x) = 0
+ reduce_xor250(x) = 0
+ Xor reductions of x = 0
+ x = 0b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111011101111110111000000111110110010001010011100001010001011001111000101101101101111001110111001100100100001100010001100000
+ reduce_xor47(x) = 1
+ reduce_xor68(x) = 1
+ reduce_xor250(x) = 1
+ Xor reductions of x = 3
+ x = 0b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011001101010100101011110011101100111101010011000111010111110101010110101001110110110110011010100110100001011001001011111011000000010111101100110100000000
+ reduce_xor47(x) = 1
+ reduce_xor68(x) = 0
+ reduce_xor250(x) = 0
+ Xor reductions of x = 1
+ x = 0b00000000000000000000000000000000000000000000000000000000000000000000110000101110001001101110011101100110100011011110101100011011111000111000110100011101101111001110000111010001101100010010000001001100100000001111011110010111111100111101110010100000000
+ reduce_xor47(x) = 1
+ reduce_xor68(x) = 1
+ reduce_xor250(x) = 1
+ Xor reductions of x = 3
+ x = 0b00000000000000000000000000000000000000110011101010001011011101001100101011010000011010111101100000010110101010011010000111101001101100010001100010111110001101000111101011101111111000111001001001110101000001111100011011100100010111000001110011100000000
+ reduce_xor47(x) = 1
+ reduce_xor68(x) = 0
+ reduce_xor250(x) = 0
+ Xor reductions of x = 1
+ x = 0b00000000011000011101111010101010001011011001011001010011110001110010110001010101110100001000110001111110111001101101011001000100101011111100010110101111111110010111000011111110101000010011111101101110110011011110110000011011001011011100111110000000000
+ reduce_xor47(x) = 1
+ reduce_xor68(x) = 1
+ reduce_xor250(x) = 0
+ Xor reductions of x = 2
+ x = 0b00100111111110001100001110011100111001111010111100100011100111001011100010111010010010100000111110010001001000000100001101000000111100100001001111001001111100011100110010001001101101010000101110100101101100011010000011011010001100110001011010000000000
+ reduce_xor47(x) = 0
+ reduce_xor68(x) = 1
+ reduce_xor250(x) = 1
+ Xor reductions of x = 2
+ x = 0b01111000101110101010011000110100110000000011111011010010010011111000110001101001001100101011011000011001111001000001010000011101110000101110100110110100101110011110101011100010011011010001011100001010110000100000011000010010010101110110111110000000000
+ reduce_xor47(x) = 1
+ reduce_xor68(x) = 0
+ reduce_xor250(x) = 0
+ Xor reductions of x = 1
+ x = 0b00011000111011111001011110010010101001100011001100101001111101101101100110011000001011000010010100000010111100000100111100010101010010100111011101101001010101101001000000010010100000000001000001110110101000011110100001010100010011110100100000000000000
+ reduce_xor47(x) = 1
+ reduce_xor68(x) = 1
+ reduce_xor250(x) = 0
+ Xor reductions of x = 2
+ x = 0b00010101101001000010010000001101101011011110010101010111100101001000101100101011000001110010101010000110101101000001101110101100011001011001001010111011000000010100111101001111111101110110000101001100011010111101011011001001110001011100000000000000000
+ reduce_xor47(x) = 0
+ reduce_xor68(x) = 1
+ reduce_xor250(x) = 1
+ Xor reductions of x = 2
+ x = 0b00011101100110101100100010101101100001100001010000001011010100100110111010111101001110000101011111011100100001011010010111001110000110110111100100010010001010000010000001110001111011110001010010000001100001000011110010110000111110111100000000000000000
+ reduce_xor47(x) = 1
+ reduce_xor68(x) = 1
+ reduce_xor250(x) = 0
+ Xor reductions of x = 2
+ x = 0b00011111011001000110001011111001001110011101000000010100001100110010110110001101111000000110101101100000001010000110001101010110001001101010001001001010001100010101100000111111001100100101010001101000100101011101000111101000001101001100000000000000000
+ reduce_xor47(x) = 1
+ reduce_xor68(x) = 1
+ reduce_xor250(x) = 1
+ Xor reductions of x = 3
+ x = 0b01100110000010001101010100010101000001111111111001001010100011011001110000010010110001110100000111110111101001110011001011111010100111101100010110101110110101110100111111111010110110111000111100011111111100101011000101111010101000000100000000000000000
+ reduce_xor47(x) = 1
+ reduce_xor68(x) = 0
+ reduce_xor250(x) = 0
+ Xor reductions of x = 1
+ x = 0b01010110011101010010101001111001011010001100110110100010011110101110010111001001011100010010011001110010100110000000110001101101000111000000000000101111010100010001100111111110100010101000010110000100110111100101100010101100111010101100000000000000000
+ reduce_xor47(x) = 1
+ reduce_xor68(x) = 1
+ reduce_xor250(x) = 0
+ Xor reductions of x = 2
+ x = 0b00011110111101010011100101111011000000010001000000011000110100100101000001100110000011001000100101100111101000101000000101110111111111111111100011111110001011001011110011011111111101000100101000010000011011111001110100100101000100010100000000000000000
+ reduce_xor47(x) = 1
+ reduce_xor68(x) = 1
+ reduce_xor250(x) = 0
+ Xor reductions of x = 2
+ x = 0b00011000111011001110001100111100101100100111011111001110110001010110000111110010100100001001101101000101000100001010010110000101011001100111101011100101100000010100011001001111111001111100111000111100011100110101110111010110000100000100000000000000000
+ reduce_xor47(x) = 0
+ reduce_xor68(x) = 1
+ reduce_xor250(x) = 1
+ Xor reductions of x = 2






More information about the llvm-commits mailing list