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

Reid Spencer reid at x10sys.com
Tue Apr 17 16:18:25 PDT 2007



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

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

Update to use bits.h


---
Diffs of the changes:  (+5 -6)

 bit_select.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)


Index: llvm-test/SingleSource/UnitTests/Integer/bit_select.c
diff -u llvm-test/SingleSource/UnitTests/Integer/bit_select.c:1.2 llvm-test/SingleSource/UnitTests/Integer/bit_select.c:1.3
--- llvm-test/SingleSource/UnitTests/Integer/bit_select.c:1.2	Mon Feb 12 11:52:59 2007
+++ llvm-test/SingleSource/UnitTests/Integer/bit_select.c	Tue Apr 17 18:18:07 2007
@@ -11,15 +11,14 @@
 //===----------------------------------------------------------------------===//
 
 #include <stdio.h>
+#include <bits.h>
 
 #ifdef ENABLE_LARGE_INTEGERS
-typedef int __attribute__((bitwidth(250))) BitType;
+typedef Int250 BitType;
 const BitType X = 0xAAAAAAAAAAAAAAAAULL;
-int numbits = 250;
 #else
-typedef int __attribute__((bitwidth(47))) BitType;
+typedef Int47 BitType;
 const BitType X = 0xAAAAAAAAAAAAULL;
-int numbits = 47;
 #endif
 
 int main(int argc, char** argv)
@@ -33,8 +32,8 @@
 
   BitType i;
 
-  for (i = numbits-1; i >= 0; --i) {
-    if (__builtin_bit_select(Y, i)) 
+  for (i = bitwidthof(BitType); i > 0; --i) {
+    if (bit_select(Y, i-1)) 
       printf("1");
     else
       printf("0");






More information about the llvm-commits mailing list