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

Reply via email to