ipa-1.c: Delete trailing spaces, put the call to f into a loop.
authorMartin Jambor <mjambor@suse.cz>
Wed, 24 Mar 2010 16:26:52 +0000 (17:26 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Wed, 24 Mar 2010 16:26:52 +0000 (17:26 +0100)
2010-03-24  Martin Jambor  <mjambor@suse.cz>

* gcc.dg/ipa/ipa-1.c: Delete trailing spaces, put the call to f into
a loop.
* gcc.dg/ipa/ipa-2.c: Likewise.
* gcc.dg/ipa/ipa-3.c: Likewise.
* gcc.dg/ipa/ipa-4.c: Likewise.
* gcc.dg/ipa/ipa-5.c: Likewise.
* gcc.dg/ipa/ipa-7.c: Likewise.
* gcc.dg/ipa/ipa-6.c: Delete trailing spaces, put the call to foo into
a loop.
* gcc.dg/ipa/ipacost-2.c: Delete trailing spaces, put the call to
i_can_not_be_propagated_fully2 into a loop.
* gcc.dg/ipa/ipa-8.c: New test.
* g++.dg/ipa/iinline-1.C: Put the call to docalling into a loop.

From-SVN: r157698

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ipa/iinline-1.C
gcc/testsuite/gcc.dg/ipa/ipa-1.c
gcc/testsuite/gcc.dg/ipa/ipa-2.c
gcc/testsuite/gcc.dg/ipa/ipa-3.c
gcc/testsuite/gcc.dg/ipa/ipa-4.c
gcc/testsuite/gcc.dg/ipa/ipa-5.c
gcc/testsuite/gcc.dg/ipa/ipa-6.c
gcc/testsuite/gcc.dg/ipa/ipa-7.c
gcc/testsuite/gcc.dg/ipa/ipa-8.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/ipa/ipacost-2.c

index d69523d..692353b 100644 (file)
@@ -1,3 +1,19 @@
+2010-03-24  Martin Jambor  <mjambor@suse.cz>
+
+       * gcc.dg/ipa/ipa-1.c: Delete trailing spaces, put the call to f into
+       a loop. 
+       * gcc.dg/ipa/ipa-2.c: Likewise.
+       * gcc.dg/ipa/ipa-3.c: Likewise.
+       * gcc.dg/ipa/ipa-4.c: Likewise.
+       * gcc.dg/ipa/ipa-5.c: Likewise.
+       * gcc.dg/ipa/ipa-7.c: Likewise.
+       * gcc.dg/ipa/ipa-6.c: Delete trailing spaces, put the call to foo into
+       a loop.
+       * gcc.dg/ipa/ipacost-2.c: Delete trailing spaces, put the call to
+       i_can_not_be_propagated_fully2 into a loop.
+       * gcc.dg/ipa/ipa-8.c: New test.
+       * g++.dg/ipa/iinline-1.C: Put the call to docalling into a loop.
+
 2010-03-24  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/19192
index b7b9345..9f99893 100644 (file)
@@ -38,8 +38,9 @@ int docalling (int (String::* f)(int delim) const)
 
 int main (int argc, char *argv[])
 {
-  int i;
-  i = docalling (&String::funcOne);
+  int i = 0;
+  while (i < 1000)
+    i += docalling (&String::funcOne);
   non_existent ("done", i);
   return 0;
 }
index 65c0a0c..e321285 100644 (file)
@@ -13,12 +13,14 @@ int f (int a)
   if (a > 0)
     g (a, 3);
   else
-    g (a, 5);  
+    g (a, 5);
 }
 int main ()
 {
-  f (7);
-  return 0;    
+  int i;
+  for (i = 0; i < 100; i++)
+    f (7);
+  return 0;
 }
 
 
index 1b94bbb..1d57fb0 100644 (file)
@@ -15,8 +15,10 @@ int f (int a)
 }
 int main ()
 {
-  f (7);
-  return 0;    
+  int i;
+  for (i = 0; i < 100; i++)
+    f (7);
+  return 0;
 }
 
 
index 57200a9..a3334c3 100644 (file)
@@ -10,19 +10,21 @@ void t(void);
 int g (double b, double c)
 {
   t();
-  return (int)(b+c);  
+  return (int)(b+c);
 }
 int f (double a)
 {
   if (a > 0)
     g (a, 3.1);
   else
-    g (a, 3.1);        
+    g (a, 3.1);
 }
 int main ()
 {
-  f (7.44);
-  return 0;    
+  int i;
+  for (i = 0; i < 100; i++)
+    f (7.44);
+  return 0;
 }
 
 
index 12af6a4..3cb0cd4 100644 (file)
@@ -9,17 +9,19 @@ int g (int b, int c)
 }
 int f (int a)
 {
-  /* First and second parameter of g gets different values.  */ 
-     
+  /* First and second parameter of g gets different values.  */
+
   if (a > 0)
     g (a, 3);
   else
-    g (a+1, 5);        
+    g (a+1, 5);
 }
 int main ()
 {
-  f (7);
-  return 0;    
+  int i;
+  for (i = 0; i < 100; i++)
+    f (7);
+  return 0;
 }
 
 
index 0ca6ba2..50af18e 100644 (file)
@@ -20,8 +20,10 @@ int f (float a)
 }
 int main ()
 {
-  f (7.6);
-  return 0;    
+  int i;
+  for (i = 0; i < 100; i++)
+    f (7.6);
+  return 0;
 }
 
 
index a22555c..c7d9b37 100644 (file)
@@ -23,7 +23,9 @@ foo (int a)
 int
 main ()
 {
-  foo (7);
+  int i;
+  for (i = 0; i < 100; i++)
+    foo (7);
   return 0;
 }
 
index b3ab0f5..6dcc914 100644 (file)
@@ -13,14 +13,16 @@ int f (int a)
   if (a > 0)
     g (a, 3);
   else
-    g (a, 5);  
-   
+    g (a, 5);
+
   send_addr (&a);
 }
 int main ()
 {
-  f (7);
-  return 0;    
+  int i;
+  for (i = 0; i < 100; i++)
+    f (7);
+  return 0;
 }
 
 
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-8.c b/gcc/testsuite/gcc.dg/ipa/ipa-8.c
new file mode 100644 (file)
index 0000000..edea7f9
--- /dev/null
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining"  } */
+/* { dg-add-options bind_pic_locally } */
+
+#include <stdio.h>
+static int g (int b, int c)
+{
+  printf ("%d %d\n", b, c);
+}
+static int f (int a)
+{
+  /* Second parameter of g gets different values.  */
+  if (a > 0)
+    g (a, 3);
+  else
+    g (a, 5);
+}
+int main ()
+{
+  f (7);
+  return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp"  } } */
+/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp"  } } */
+/* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp"  } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+
+
index d06c9b8..6ebd6d3 100644 (file)
@@ -6,7 +6,7 @@ int array[100];
 
 int t(int);
 
-static int 
+static int
 i_can_be_propagated_fully (int *a)
 {
   int i;
@@ -18,14 +18,14 @@ i_can_be_propagated_fully (int *a)
     t(a[i+3]);
   }
 }
-static int 
+static int
 i_can_be_propagated_fully2 (int *a)
 {
   i_can_be_propagated_fully (a);
   i_can_be_propagated_fully (a);
   i_can_be_propagated_fully (a);
 }
-static int 
+static int
 i_can_not_be_propagated_fully (int *a)
 {
   int i;
@@ -37,7 +37,7 @@ i_can_not_be_propagated_fully (int *a)
     t(a[i+3]);
   }
 }
-int 
+int
 i_can_not_be_propagated_fully2 (int *a)
 {
   i_can_not_be_propagated_fully (a);
@@ -46,9 +46,12 @@ i_can_not_be_propagated_fully2 (int *a)
 }
 main()
 {
+  int i;
   i_can_be_propagated_fully2 (array);
   i_can_be_propagated_fully2 (array);
-  i_can_not_be_propagated_fully2 (array);
+
+  for (i = 0; i < 100; i++)
+    i_can_not_be_propagated_fully2 (array);
   i_can_not_be_propagated_fully2 (array);
 }