[llvm-commits] [test-suite] r49992 - in /test-suite/trunk/SingleSource/UnitTests: 2008-04-18-LoopBug.c 2008-04-20-LoopBug2.c

Dale Johannesen dalej at apple.com
Sun Apr 20 10:00:14 PDT 2008


Author: johannes
Date: Sun Apr 20 12:00:14 2008
New Revision: 49992

URL: http://llvm.org/viewvc/llvm-project?rev=49992&view=rev
Log:
New test.  Pedantic changes to previous test.


Added:
    test-suite/trunk/SingleSource/UnitTests/2008-04-20-LoopBug2.c
Modified:
    test-suite/trunk/SingleSource/UnitTests/2008-04-18-LoopBug.c

Modified: test-suite/trunk/SingleSource/UnitTests/2008-04-18-LoopBug.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/2008-04-18-LoopBug.c?rev=49992&r1=49991&r2=49992&view=diff

==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/2008-04-18-LoopBug.c (original)
+++ test-suite/trunk/SingleSource/UnitTests/2008-04-18-LoopBug.c Sun Apr 20 12:00:14 2008
@@ -1,3 +1,5 @@
+extern int printf(const char*, ...);
+void foo( unsigned int i, int array[4]) __attribute__((noinline));
 void foo( unsigned int i, int array[4]) {
   unsigned int j;
   for (j=3; j>i; j--)

Added: test-suite/trunk/SingleSource/UnitTests/2008-04-20-LoopBug2.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/2008-04-20-LoopBug2.c?rev=49992&view=auto

==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/2008-04-20-LoopBug2.c (added)
+++ test-suite/trunk/SingleSource/UnitTests/2008-04-20-LoopBug2.c Sun Apr 20 12:00:14 2008
@@ -0,0 +1,20 @@
+extern int printf(const char*, ...);
+void foo( unsigned int i, int array[4]) __attribute__((noinline));
+void foo( unsigned int i, int array[4]) {
+  unsigned int j=3;
+  do {
+    array[j] = array[j-1];
+    j--;
+  }  while (j>i);
+  printf("%d %d %d %d %d\n", i, array[0], array[1], array[2], array[3]);
+}
+main() {
+  int array[4], i;
+  for (i=0; i<5; i++) {
+    array[0] = 5; array[1] = 6; array[2] = 7; array[3] = 8;
+    foo(i, array);
+  }
+  array[0] = 5; array[1] = 6; array[2] = 7; array[3] = 8;
+  foo(0xffffffffU, array);
+  return 0;
+}





More information about the llvm-commits mailing list