[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/constval.cpp constval.reference_output

Reid Spencer reid at x10sys.com
Wed May 16 12:34:55 PDT 2007



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

constval.cpp updated: 1.1 -> 1.2
constval.reference_output updated: 1.1 -> 1.2
---
Log message:

Augment this test case to check conversions of radix 2, 8 and 16 values 
as well as just radix 10.


---
Diffs of the changes:  (+22 -4)

 constval.cpp              |   19 +++++++++++++++++--
 constval.reference_output |    7 +++++--
 2 files changed, 22 insertions(+), 4 deletions(-)


Index: llvm-test/SingleSource/UnitTests/Integer/constval.cpp
diff -u llvm-test/SingleSource/UnitTests/Integer/constval.cpp:1.1 llvm-test/SingleSource/UnitTests/Integer/constval.cpp:1.2
--- llvm-test/SingleSource/UnitTests/Integer/constval.cpp:1.1	Tue Apr 17 19:53:49 2007
+++ llvm-test/SingleSource/UnitTests/Integer/constval.cpp	Wed May 16 14:34:37 2007
@@ -15,9 +15,24 @@
 void my_test()
 {
   uint21 x = bitsFromString("123456", 21);
+  printf( "x = %d = ", int(x));
+  printBits(x);
+
   uint16 y = bitsFromString("123456", 16);
-  printf( "x = %d\n", int(x));
-  printf( "y = %d\n", int(y));
+  printf( "\ny = %d = ", int(y));
+  printBits(y);
+
+  int256 z = bitsFromHexString("0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 256); 
+  printf( "\nz = " );
+  printBits(z);
+
+  int69 a = bitsFromOctalString("01234567012345670123456", 69);
+  printf( "\na = " );
+  printBits(a);
+  int68 b = bitsFromBinaryString("10101010101010101010101010101010101010101010101010101010101010101010", 68);
+  printf( "\nb = " );
+  printBits(b);
+  printf("\n");
 }
 
 int main(int argc, char** argv)


Index: llvm-test/SingleSource/UnitTests/Integer/constval.reference_output
diff -u llvm-test/SingleSource/UnitTests/Integer/constval.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/constval.reference_output:1.2
--- llvm-test/SingleSource/UnitTests/Integer/constval.reference_output:1.1	Tue Apr 17 19:53:49 2007
+++ llvm-test/SingleSource/UnitTests/Integer/constval.reference_output	Wed May 16 14:34:37 2007
@@ -1,3 +1,6 @@
-x = 123456
-y = 57920
+x = 123456 = 000011110001001000000
+y = 57920 = 1110001001000000
+z = 0000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
+a = 000001010011100101110111000001010011100101110111000001010011100101110
+b = 10101010101010101010101010101010101010101010101010101010101010101010
 exit 0






More information about the llvm-commits mailing list