Add dg-final-scan-autofdo and dg-final-scan-not-autofdo
authorAndi Kleen <ak@linux.intel.com>
Thu, 14 Jul 2016 02:14:13 +0000 (02:14 +0000)
committerAndi Kleen <ak@gcc.gnu.org>
Thu, 14 Jul 2016 02:14:13 +0000 (02:14 +0000)
Autofdo outputs to different dump files and doesn't support some
transformation that normal profiling. Add dg-final-scan-autofdo
and dg-final-scan-not-autofdo statements to the test suite
so that the test cases can hande those cases separately.

gcc/testsuite/:

2016-07-13  Andi Kleen  <ak@linux.intel.com>

* lib/profopt.exp (dg-final-scan-autofdo,
dg-final-scan-not-autofdo): New functions.

From-SVN: r238322

gcc/testsuite/ChangeLog
gcc/testsuite/lib/profopt.exp

index f868af33cc5401be0b57185ccd552f8fdba97c92..871475614c7aef9cdb21b2a64fca771bc8b8ff13 100644 (file)
@@ -1,3 +1,8 @@
+2016-07-13  Andi Kleen  <ak@linux.intel.com>
+
+       * lib/profopt.exp (dg-final-scan-autofdo,
+       dg-final-scan-not-autofdo): New functions.
+
 2016-07-13  Bin Cheng  <bin.cheng@arm.com>
 
        * gcc.dg/vect/vect-35-big-array.c: Refine comment and test.
index b3e2b2e2e930806026539c1af34d12a560cf53d1..3cce2ee2ffb6adbb42fbde9eba1e720e568f6876 100644 (file)
@@ -170,6 +170,47 @@ proc dg-final-use { args } {
     append use_final_code "[lindex $args 1]\n"
 }
 
+#
+# dg-final-use-not-autofdo -- process code to run after the profile-use step
+# but only if not running autofdo
+# ARGS is the line number of the directive followed by the commands.
+#
+proc dg-final-use-not-autofdo { args } {
+    global use_final_code
+    global run_autofdo
+
+    if { [llength $args] > 2 } {
+       error "[lindex $args 0]: too many arguments"
+       return
+    }
+
+    if { $run_autofdo == 1 } {
+        return
+    }
+    append use_final_code "[lindex $args 1]\n"
+}
+
+#
+# dg-final-use-autofdo -- process code to run after the profile-use step
+# but only if running autofdo
+# ARGS is the line number of the directive followed by the commands.
+#
+
+proc dg-final-use-autofdo { args } {
+    global use_final_code
+    global run_autofdo
+
+    if { [llength $args] > 2 } {
+       error "[lindex $args 0]: too many arguments"
+       return
+    }
+
+    if { $run_autofdo != 1 } {
+        return
+    }
+    append use_final_code "[lindex $args 1]\n"
+}
+
 #
 # profopt-final-code -- run final code
 #
@@ -210,6 +251,8 @@ proc profopt-get-options { src } {
             || ![string compare "dg-skip-if" $cmd] \
             || ![string compare "dg-final-generate" $cmd] \
             || ![string compare "dg-final-use" $cmd] \
+            || ![string compare "dg-final-use-not-autofdo" $cmd] \
+            || ![string compare "dg-final-use-autofdo" $cmd] \
              || ![string compare "dg-additional-sources" $cmd] \
             || [string match "dg-require-*" $cmd]  } {
            set status [catch "$op" errmsg]