Add new effective target: profile_update_atomic
authorMartin Liska <mliska@suse.cz>
Tue, 13 Sep 2016 13:30:13 +0000 (15:30 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 13 Sep 2016 13:30:13 +0000 (13:30 +0000)
* g++.dg/gcov/gcov-threads-1.C: Use profile_update_atomic
effective target.
* gcc.dg/tree-prof/val-profiler-threads-1.c: Likewise.
* lib/target-supports.exp: Define the new target.

From-SVN: r240111

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/gcov/gcov-threads-1.C
gcc/testsuite/gcc.dg/tree-prof/val-profiler-threads-1.c
gcc/testsuite/lib/target-supports.exp

index 9e59b031c574c75a60382f98425d07f2edbd01dc..d9d682577bcfeb6f775366de89dba009124f65a7 100644 (file)
@@ -1,3 +1,10 @@
+2016-09-13  Martin Liska  <mliska@suse.cz>
+
+       * g++.dg/gcov/gcov-threads-1.C: Use profile_update_atomic
+       effective target.
+       * gcc.dg/tree-prof/val-profiler-threads-1.c: Likewise.
+       * lib/target-supports.exp: Define the new target.
+
 2016-09-12  Andrew Pinski  <apinski@cavium.com>
 
        * gcc.target/aarch64/thunderxloadpair.c: New testcase.
index a4a6f0a6ae388304827dad269a528ca12d36d8aa..cc9266ab8ea47b191f524188e945954d7af5f7b9 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-options "-fprofile-arcs -ftest-coverage -pthread -fprofile-update=atomic" } */
 /* { dg-do run { target native } } */
+/* { dg-require-effective-target profile_update_atomic } */
 
 #include <stdint.h>
 #include <pthread.h>
index e9b04a0e67d7c8b91e9516380c15c2da880e1aa9..95d6ee3b4a3184be9ae489561fecd49285cb443b 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-options "-O0 -pthread -fprofile-update=atomic" } */
+/* { dg-require-effective-target profile_update_atomic } */
+
 #include <pthread.h>
 
 #define NUM_THREADS    8
index 545b3dc38c9d57c63d67eb1abd069fdca7b00660..6724a7fd214e91299f7b47563cff2d6e6611c3da 100644 (file)
@@ -7699,3 +7699,10 @@ proc check_effective_target_offload_hsa { } {
        int main () {return 0;}
     } "-foffload=hsa" ]
 }
+
+# Return 1 if the target support -fprofile-update=atomic
+proc check_effective_target_profile_update_atomic {} {
+    return [check_no_compiler_messages profile_update_atomic assembly {
+       int main (void) { return 0; }
+    } "-fprofile-update=atomic -fprofile-generate"]
+}