[llvm-commits] CVS: llvm/test/Programs/SingleSource/UnitTests/2002-05-19-DivTest.c
Vikram Adve
vadve at cs.uiuc.edu
Mon Jul 7 17:48:01 PDT 2003
Changes in directory llvm/test/Programs/SingleSource/UnitTests:
2002-05-19-DivTest.c updated: 1.1 -> 1.2
---
Log message:
Made this much more useful by using
(a) larger shifts than just 1,
(b) shifts with different ranges, and
(c) separate tests for 32-bit and 64-bit operands.
---
Diffs of the changes:
Index: llvm/test/Programs/SingleSource/UnitTests/2002-05-19-DivTest.c
diff -u llvm/test/Programs/SingleSource/UnitTests/2002-05-19-DivTest.c:1.1 llvm/test/Programs/SingleSource/UnitTests/2002-05-19-DivTest.c:1.2
--- llvm/test/Programs/SingleSource/UnitTests/2002-05-19-DivTest.c:1.1 Fri Aug 2 11:24:23 2002
+++ llvm/test/Programs/SingleSource/UnitTests/2002-05-19-DivTest.c Mon Jul 7 17:46:59 2003
@@ -1,11 +1,26 @@
extern int printf(const char *, ...);
+void testL(long Arg) {
+ printf("%ld\n", Arg / (1LL << 4));
+ printf("%ld\n", Arg / (1LL << 46));
+}
+
void test(int Arg) {
- printf("%d\n", Arg / 2);
+ printf("%d\n", Arg / (1 << 0));
+ printf("%d\n", Arg / (1 << 4));
+ printf("%d\n", Arg / (1 << 18));
+ printf("%d\n", Arg / (1 << 30));
}
int main() {
- test(-21);
- test(-22);
- return 0;
+ int B20 = - (1 << 20);
+ long B53 = - (1LL << 53);
+
+ test(B20 + 32);
+ test(B20 + 33);
+
+ testL(B53 + 64);
+ testL(B53 + 65);
+
+ return 0;
}
More information about the llvm-commits
mailing list