[llvm-commits] CVS: llvm/test/Programs/SingleSource/UnitTests/2003-05-31-LongShifts.c
Chris Lattner
lattner at cs.uiuc.edu
Sat May 31 20:58:12 PDT 2003
Changes in directory llvm/test/Programs/SingleSource/UnitTests:
2003-05-31-LongShifts.c added (r1.1)
---
Log message:
A simple test to make sure 64 bit shifts are handled correctly
---
Diffs of the changes:
Index: llvm/test/Programs/SingleSource/UnitTests/2003-05-31-LongShifts.c
diff -c /dev/null llvm/test/Programs/SingleSource/UnitTests/2003-05-31-LongShifts.c:1.1
*** /dev/null Sat May 31 20:57:35 2003
--- llvm/test/Programs/SingleSource/UnitTests/2003-05-31-LongShifts.c Sat May 31 20:57:25 2003
***************
*** 0 ****
--- 1,18 ----
+
+ void Test(long long Val, int Amt) {
+ printf("0x%llx op %d:\n", Val, Amt);
+ printf(" sar: 0x%llx\n shr: 0x%llx\n shl: 0x%llx\n", Val >> Amt,
+ (unsigned long long)Val >> Amt, Val << Amt);
+ }
+
+ int main() {
+ Test(123, 4);
+ Test(123, 34);
+ Test(-4, 4);
+ Test(-5, 34);
+ Test(-6000000000LL, 4);
+ Test(-6000000000LL, 34);
+ Test( 6000000000LL, 4);
+ Test( 6000000000LL, 34);
+ return 0;
+ }
More information about the llvm-commits
mailing list