diff mbox

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

Message ID 20110930204428.4C308B2190@azwildcat.mtv.corp.google.com
State New
Headers show

Commit Message

Sriraman Tallam Sept. 30, 2011, 8:44 p.m. UTC
Disable running of callgraph-profiles.C is section attribute "e" is not supported.


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

Comments

Diego Novillo Sept. 30, 2011, 8:48 p.m. UTC | #1
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.
Sriraman Tallam Sept. 30, 2011, 8:50 p.m. UTC | #2
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 <tmsriram@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
>
Sriraman Tallam Sept. 30, 2011, 8:50 p.m. UTC | #3
On Fri, Sep 30, 2011 at 1:48 PM, Diego Novillo <dnovillo@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.
>
Diego Novillo Sept. 30, 2011, 8:51 p.m. UTC | #4
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?
Sriraman Tallam Sept. 30, 2011, 8:53 p.m. UTC | #5
On Fri, Sep 30, 2011 at 1:51 PM, Diego Novillo <dnovillo@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.

>
diff mbox

Patch

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 ()