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

2007-05-16 Thread Reid Spencer


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("0fff",
 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 = 000100100
+y = 57920 = 111000100100
+z = 

+a = 010100111001011101110101001110010111011101010011100101110
+b = 10101010101010101010101010101010101010101010101010101010101010101010
 exit 0



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


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

2007-05-17 Thread Reid Spencer


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

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

Update to include a test case with a signed value to ensure sign 
extension is working correctly.


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

 constval.cpp  |6 ++
 constval.reference_output |1 +
 2 files changed, 7 insertions(+)


Index: llvm-test/SingleSource/UnitTests/Integer/constval.cpp
diff -u llvm-test/SingleSource/UnitTests/Integer/constval.cpp:1.2 
llvm-test/SingleSource/UnitTests/Integer/constval.cpp:1.3
--- llvm-test/SingleSource/UnitTests/Integer/constval.cpp:1.2   Wed May 16 
14:34:37 2007
+++ llvm-test/SingleSource/UnitTests/Integer/constval.cpp   Thu May 17 
12:29:58 2007
@@ -29,9 +29,15 @@
   int69 a = bitsFromOctalString("01234567012345670123456", 69);
   printf( "\na = " );
   printBits(a);
+
   int68 b = 
bitsFromBinaryString("10101010101010101010101010101010101010101010101010101010101010101010",
 68);
   printf( "\nb = " );
   printBits(b);
+
+  int169 c = bitsFromString("-1234567890123456789012345678901234567890", 169);
+  printf( "\nc = " );
+  printBits(c);
+
   printf("\n");
 }
 


Index: llvm-test/SingleSource/UnitTests/Integer/constval.reference_output
diff -u llvm-test/SingleSource/UnitTests/Integer/constval.reference_output:1.2 
llvm-test/SingleSource/UnitTests/Integer/constval.reference_output:1.3
--- llvm-test/SingleSource/UnitTests/Integer/constval.reference_output:1.2  
Wed May 16 14:34:37 2007
+++ llvm-test/SingleSource/UnitTests/Integer/constval.reference_output  Thu May 
17 12:29:58 2007
@@ -3,4 +3,5 @@
 z = 

 a = 010100111001011101110101001110010111011101010011100101110
 b = 10101010101010101010101010101010101010101010101010101010101010101010
+c = 
11100010100110110110110001010001100100100110001000111010100110111101001101001001100011100010100101110
 exit 0



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits