[google]Make test callgraph-profiles.C run only when section attribute e is supported (issue5167045)

2011-09-30 Thread Sriraman Tallam
Disable running of callgraph-profiles.C is section attribute e is not 
supported.

Index: lib/target-supports-dg.exp
===
--- lib/target-supports-dg.exp  (revision 179400)
+++ lib/target-supports-dg.exp  (working copy)
@@ -100,6 +100,16 @@
 }
 }
 
+# If this target does not support the section exclude e attribute,
+# skip this test.
+
+proc dg-require-section-exclude { args } {
+if { ![ check_section_exclude_available ] } {
+   upvar dg-do-what dg-do-what
+   set dg-do-what [list [lindex ${dg-do-what} 0] N P]
+}
+}
+
 # If this target's linker does not support the --gc-sections flag,
 # skip this test.
 
Index: lib/target-supports.exp
===
--- lib/target-supports.exp (revision 179400)
+++ lib/target-supports.exp (working copy)
@@ -382,6 +382,18 @@
 }]
 }
 
+# Returns true if tool chain supports e section attribute.
+
+proc check_section_exclude_available { } {
+return [check_runtime_nocache section_exclude_available {
+   asm(.section \.gnu.callgraph.text.main\, \e\);
+   int main()
+   {
+ return 0;
+   }
+  }]
+}
+
 # Returns true if --gc-sections is supported on the target.
 
 proc check_gc_sections_available { } {
Index: g++.dg/tree-prof/callgraph-profiles.C
===
--- g++.dg/tree-prof/callgraph-profiles.C   (revision 179400)
+++ g++.dg/tree-prof/callgraph-profiles.C   (working copy)
@@ -1,6 +1,7 @@
 /* Verify if call-graph profile sections are created
with -fcallgraph-profiles-sections. */
 /* { dg-options -O2 -fcallgraph-profiles-sections -ffunction-sections 
--save-temps } */
+/* { dg-require-section-exclude  } */
 
 int __attribute__ ((noinline))
 foo ()

--
This patch is available for review at http://codereview.appspot.com/5167045


Re: [google]Make test callgraph-profiles.C run only when section attribute e is supported (issue5167045)

2011-09-30 Thread Diego Novillo

On 11-09-30 16:44 , Sriraman Tallam wrote:

Disable running of callgraph-profiles.C is section attribute e is not 
supported.


OK with a ChangeLog entry.

Was the original patch sent to trunk?  I don't recall.


Diego.


Re: [google]Make test callgraph-profiles.C run only when section attribute e is supported (issue5167045)

2011-09-30 Thread Sriraman Tallam
ChangeLog entry:


* testsuite/g++.dg/tree-prof/callgraph-profiles/C:  Add
dg-require-section-exclude. * testsuite/lib/target-supports.exp
(check_ifunc_available): New proc.  *
testsuite/lib/target-supports-dg.exp (dg-require-section-exclude):  New
proc.


On Fri, Sep 30, 2011 at 1:44 PM, Sriraman Tallam tmsri...@google.com wrote:
 Disable running of callgraph-profiles.C is section attribute e is not 
 supported.

 Index: lib/target-supports-dg.exp
 ===
 --- lib/target-supports-dg.exp  (revision 179400)
 +++ lib/target-supports-dg.exp  (working copy)
 @@ -100,6 +100,16 @@
     }
  }

 +# If this target does not support the section exclude e attribute,
 +# skip this test.
 +
 +proc dg-require-section-exclude { args } {
 +    if { ![ check_section_exclude_available ] } {
 +       upvar dg-do-what dg-do-what
 +       set dg-do-what [list [lindex ${dg-do-what} 0] N P]
 +    }
 +}
 +
  # If this target's linker does not support the --gc-sections flag,
  # skip this test.

 Index: lib/target-supports.exp
 ===
 --- lib/target-supports.exp     (revision 179400)
 +++ lib/target-supports.exp     (working copy)
 @@ -382,6 +382,18 @@
     }]
  }

 +# Returns true if tool chain supports e section attribute.
 +
 +proc check_section_exclude_available { } {
 +    return [check_runtime_nocache section_exclude_available {
 +               asm(.section \.gnu.callgraph.text.main\, \e\);
 +               int main()
 +               {
 +                 return 0;
 +               }
 +  }]
 +}
 +
  # Returns true if --gc-sections is supported on the target.

  proc check_gc_sections_available { } {
 Index: g++.dg/tree-prof/callgraph-profiles.C
 ===
 --- g++.dg/tree-prof/callgraph-profiles.C       (revision 179400)
 +++ g++.dg/tree-prof/callgraph-profiles.C       (working copy)
 @@ -1,6 +1,7 @@
  /* Verify if call-graph profile sections are created
    with -fcallgraph-profiles-sections. */
  /* { dg-options -O2 -fcallgraph-profiles-sections -ffunction-sections 
 --save-temps } */
 +/* { dg-require-section-exclude  } */

  int __attribute__ ((noinline))
  foo ()

 --
 This patch is available for review at http://codereview.appspot.com/5167045



Re: [google]Make test callgraph-profiles.C run only when section attribute e is supported (issue5167045)

2011-09-30 Thread Sriraman Tallam
On Fri, Sep 30, 2011 at 1:48 PM, Diego Novillo dnovi...@google.com wrote:
 On 11-09-30 16:44 , Sriraman Tallam wrote:

 Disable running of callgraph-profiles.C is section attribute e is not
 supported.

 OK with a ChangeLog entry.

 Was the original patch sent to trunk?  I don't recall.

This was only sent to google/gcc-4_6 branch.
Thanks.




 Diego.



Re: [google]Make test callgraph-profiles.C run only when section attribute e is supported (issue5167045)

2011-09-30 Thread Diego Novillo

On 11-09-30 16:50 , Sriraman Tallam wrote:

ChangeLog entry:


* testsuite/g++.dg/tree-prof/callgraph-profiles/C:  Add
dg-require-section-exclude. * testsuite/lib/target-supports.exp
(check_ifunc_available): New proc.  *
testsuite/lib/target-supports-dg.exp (dg-require-section-exclude):  New
proc.


Bad cut and paste?


Re: [google]Make test callgraph-profiles.C run only when section attribute e is supported (issue5167045)

2011-09-30 Thread Sriraman Tallam
On Fri, Sep 30, 2011 at 1:51 PM, Diego Novillo dnovi...@google.com wrote:
 On 11-09-30 16:50 , Sriraman Tallam wrote:

 ChangeLog entry:


        * testsuite/g++.dg/tree-prof/callgraph-profiles/C:      Add
 dg-require-section-exclude.     * testsuite/lib/target-supports.exp
 (check_ifunc_available): New proc.      *
 testsuite/lib/target-supports-dg.exp (dg-require-section-exclude):
  New
 proc.

 Bad cut and paste?

Yes, sorry. Patch submitted. Thanks.

* testsuite/g++.dg/tree-prof/callgraph-profiles/C:
Add dg-require-section-exclude.
* testsuite/lib/target-supports.exp (check_ifunc_available): New proc.
* testsuite/lib/target-supports-dg.exp (dg-require-section-exclude):
New proc.