summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-29 20:29:30 +0000
committerChris Lattner <sabre@nondot.org>2002-04-29 20:29:30 +0000
commit91b078dd541b683957a5e449d2c68284c86bbe46 (patch)
tree7d90d6ed22833fb2560b98a96cf81c4fb1e1304c /tools
parent94cf3b1c67017cfefcdb81bc8ce705297efc4dfb (diff)
downloadllvm-91b078dd541b683957a5e449d2c68284c86bbe46.tar.gz
llvm-91b078dd541b683957a5e449d2c68284c86bbe46.tar.bz2
llvm-91b078dd541b683957a5e449d2c68284c86bbe46.tar.xz
These aren't tools
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/tests/Makefile13
-rw-r--r--tools/tests/testPow2.cpp46
2 files changed, 0 insertions, 59 deletions
diff --git a/tools/tests/Makefile b/tools/tests/Makefile
deleted file mode 100644
index 5dbcf7f62b..0000000000
--- a/tools/tests/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-LEVEL = ../..
-include $(LEVEL)/Makefile.common
-
-all:: testPow2
-
-clean::
- rm -f testPow2
-
-testPow2 : $(ObjectsG)
- $(LinkG) -o testPow2 $(ObjectsG) -lsupport
-
-run: testPow2
- testPow2 25
diff --git a/tools/tests/testPow2.cpp b/tools/tests/testPow2.cpp
deleted file mode 100644
index d9ecb4a72e..0000000000
--- a/tools/tests/testPow2.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*-c++-*- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "llvm/Support/MathExtras.h"
-
-inline void
-testPow(int C, bool isPow)
-{
- unsigned pow = 0;
- bool testIsPow = IsPowerOf2(C, pow);
- if (isPow != testIsPow)
- printf("ERROR: IsPowerOf2() says \t%d %s a power of 2 = %d\n",
- C, (isPow? "IS" : "IS NOT"), pow);
-
-#undef PRINT_CORRECT_RESULTS
-#ifdef PRINT_CORRECT_RESULTS
- else
- printf("CORRECT: IsPowerOf2() says \t%d %s a power of 2 = %d\n",
- C, (isPow? "IS" : "IS NOT"), pow);
-#endif PRINT_CORRECT_RESULTS
-}
-
-int
-main(int argc, char** argv)
-{
- unsigned L = (argc > 1)? atoi(argv[1]) : 16;
- unsigned C = 1;
-
- testPow(0, false);
-
- for (unsigned i = 1; i < L; i++, C = C << 1)
- {
- testPow(C, true);
- testPow(-C, true);
- for (unsigned j = C+1; j < (C << 1); j++)
- {
- testPow(j, false);
- testPow(-j, false);
- }
- }
-
- return 0;
-}
-
-