[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/2003-05-31-LongShifts.c

Chris Lattner lattner at cs.uiuc.edu
Wed Aug 31 12:08:11 PDT 2005



Changes in directory llvm-test/SingleSource/UnitTests:

2003-05-31-LongShifts.c updated: 1.1 -> 1.2
---
Log message:

Make this test not get constant folded away.


---
Diffs of the changes:  (+16 -9)

 2003-05-31-LongShifts.c |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)


Index: llvm-test/SingleSource/UnitTests/2003-05-31-LongShifts.c
diff -u llvm-test/SingleSource/UnitTests/2003-05-31-LongShifts.c:1.1 llvm-test/SingleSource/UnitTests/2003-05-31-LongShifts.c:1.2
--- llvm-test/SingleSource/UnitTests/2003-05-31-LongShifts.c:1.1	Sat May 31 20:57:25 2003
+++ llvm-test/SingleSource/UnitTests/2003-05-31-LongShifts.c	Wed Aug 31 14:07:59 2005
@@ -5,14 +5,21 @@
          (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);
+volatile struct {
+  long long A;  int V;
+} Vals[] = {
+  { 123, 4},
+  { 123, 34},
+  {-4, 4},
+  {-5, 34},
+  { -6000000000LL, 4}, 
+  { -6000000000LL, 34}, 
+  {  6000000000LL, 4}, 
+  {  6000000000LL, 34}
+};
+
+int main(int argc, char**argv) {
+  for (argc--; argc < sizeof(Vals)/sizeof(Vals[0]); ++argc)
+    Test(Vals[argc].A, Vals[argc].V);
   return 0;
 }






More information about the llvm-commits mailing list