gcc-dg.exp (dg-require-profiling): New function.
authorMark Mitchell <mark@codesourcery.com>
Tue, 23 Dec 2003 23:55:06 +0000 (23:55 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Tue, 23 Dec 2003 23:55:06 +0000 (23:55 +0000)
* lib/gcc-dg.exp (dg-require-profiling): New function.
* lib/target-supports.exp (check_profiling_available): Likewise.
* g++.dg/bprob/bprob.exp: Use check_profiling_available.
* g77.dg/bprob/bprob.exp: Likewise.
* gcc.misc-tests/bprob.exp: Likewise.
* g++.old-deja/g++.law/profile1.C: Use dg-require-profiling.
* gcc.dg/20021014-1.c: Likewise.
* gcc.dg/nest.c: Likewise.

From-SVN: r74995

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/bprob/bprob.exp
gcc/testsuite/g++.old-deja/g++.law/profile1.C
gcc/testsuite/g77.dg/bprob/bprob.exp
gcc/testsuite/gcc.dg/20021014-1.c
gcc/testsuite/gcc.dg/nest.c
gcc/testsuite/gcc.misc-tests/bprob.exp
gcc/testsuite/lib/gcc-dg.exp
gcc/testsuite/lib/target-supports.exp

index fea6e364c51aba12ecd91daee70c392a58fef7ab..f1558a7ebe32bc9ffc79fad1bd4a023d95683ccb 100644 (file)
@@ -1,3 +1,14 @@
+2003-12-23  Mark Mitchell  <mark@codesourcery.com>
+
+       * lib/gcc-dg.exp (dg-require-profiling): New function.
+       * lib/target-supports.exp (check_profiling_available): Likewise.
+       * g++.dg/bprob/bprob.exp: Use check_profiling_available.
+       * g77.dg/bprob/bprob.exp: Likewise.
+       * gcc.misc-tests/bprob.exp: Likewise.
+       * g++.old-deja/g++.law/profile1.C: Use dg-require-profiling.
+       * gcc.dg/20021014-1.c: Likewise.
+       * gcc.dg/nest.c: Likewise.
+
 2003-12-23  Mark Mitchell  <mark@codesourcery.com>
 
        * g++.dg/lookup/java1.C: Use -fdollars-in-identifiers when
index 83a7de95c6a7f09fb89e6673d6317da30ba8e3bc..35bec3378620be57d5e7595843ad4a5bf3cb26b8 100644 (file)
 
 # Some targets don't have any implementation of __bb_init_func or are
 # missing other needed machinery.
-if { [istarget mmix-*-*]
-     || [istarget arm*-*-elf]
-     || [istarget strongarm*-*-elf]
-     || [istarget xscale*-*-elf]
-     || [istarget cris-*-*] } {
+if { ![check_profiling_available] } {
     return
 }
 
index 24a79b438a6a3fe91b1e97f19bf2a1be67a81c7f..0a03bff6e80177b8c375d9dfe3b8bf211e445661 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-do run { xfail m68k-motorola-sysv m88k-motorola-sysv3 mips*-*-* i[3456]86-*-sco3.2v5* } }
+// { dg-require-profiling "" }
 // { dg-options "-pg" }
 // { dg-options "-pg -static" { target hppa*-*-hpux* } }
 // GROUPS passed profiling
index 771a7aa716c668f0399c7cab5ec9551a577fa4fb..e30234e12cfa0083480f7827d6bc884fa2f02d33 100644 (file)
 
 # Some targets don't have any implementation of __bb_init_func or are
 # missing other needed machinery.
-if { [istarget mmix-*-*]
-     || [istarget arm*-*-elf]
-     || [istarget strongarm*-*-elf]
-     || [istarget xscale*-*-elf]
-     || [istarget cris-*-*] } {
+if { ![check_profiling_available] } {
     return
 }
 
index e6dcf2ff82320423f3c1613e8329951920c2f3f7..1e2b76c761430432f4f63ca01f0d8a0e473da36d 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do run } */
+/* { dg-require-profiling "" } */
 /* { dg-options "-O2 -p" } */
 /* { dg-options "-O2 -p -static" { target hppa*-*-hpux* } } */
-/* { dg-error "profiler" "No profiler support" { target mmix-*-* xstormy16-*-* *-*-windiss } 0 } */
+/* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */
 /* { dg-error "" "consider using `-pg' instead of `-p' with gprof(1)" { target *-*-freebsd* } 0 } */
 /* Support for -p on solaris2 relies on mcrt1.o which comes with the
    vendor compiler.  We cannot reiably predict the directory where the
index 4cc058d217aecc68c513a3238f1c74d21671af9b..872feade5810e6567c8f8f9d647df622783fdbf1 100644 (file)
@@ -1,8 +1,9 @@
 /* PR 5967, PR 7114 */
 /* { dg-do run } */
+/* { dg-require-profiling "" } */
 /* { dg-options "-O2 -pg" } */
 /* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */
-/* { dg-error "profiler" "No profiler support" { target mmix-*-* xstormy16-*-* *-*-windiss } 0 } */
+/* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */
 /* Support for -pg on irix relies on gcrt1.o which doesn't exist yet.
    See: http://gcc.gnu.org/ml/gcc/2002-10/msg00169.html */
 /* { dg-error "gcrt1.o" "Profiler support missing" { target mips*-*-irix* } 0 } */
index 81a2968d128f2c0bf35bf0028b14271c7d86f244..df59900a844d276e3651b05e7a40970aff1e1a6b 100644 (file)
 
 # Some targets don't have any implementation of __bb_init_func or are
 # missing other needed machinery.
-if { [istarget mmix-*-*]
-     || [istarget arm*-*-elf]
-     || [istarget strongarm*-*-elf]
-     || [istarget xscale*-*-elf]
-     || [istarget cris-*-*]
-     || [istarget h8300-*-*] } {
+if { ![check_profiling_available] } {
     return
 }
 
index f2ba88eec4742b6aa2cde0f1c2edcabb67373918..c67766793892814efdeafe4385cc3ac0cb36d27b 100644 (file)
@@ -321,6 +321,16 @@ proc dg-require-gc-sections { args } {
     }
 }
 
+# If this target does not support profiling, skip this test.
+
+proc dg-require-profiling { args } {
+    if { ![ check_profiling_available ] } {
+       upvar dg-do-what dg-do-what
+       set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+       return
+    }
+}
+
 # If this target does not support DLL attributes skip this test.
 
 proc dg-require-dll { args } { 
index e9a57a1b7c2995bbf0ccad6e3d37424d7b362b6a..bff0a4f4441601f466c4a8d91de4667ab77a7491 100644 (file)
@@ -161,3 +161,27 @@ proc check_gc_sections_available { } {
     }
     return $gc_sections_available_saved
 }
+
+# Return true if profiling is supported on the target.
+
+proc check_profiling_available { } {
+    global profiling_available_saved
+
+    if {![info exists profiling_available_saved]} {
+       # Some targets don't have any implementation of __bb_init_func or are
+       # missing other needed machinery.
+       if { [istarget mmix-*-*]
+            || [istarget arm*-*-elf]
+            || [istarget strongarm*-*-elf]
+            || [istarget xscale*-*-elf]
+            || [istarget cris-*-*]
+            || [istarget h8300-*-*] 
+            || [istarget *-*-windiss] } {
+           set profiling_available_saved 0
+       } else {
+           set profiling_available_saved 1
+       }
+    }
+    
+    return $profiling_available_saved
+}