This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]