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]

[Patch]: improve solaris2 and irix6 testsuite profiling bypass


Currently solaris2 and irix6 use dg-error to work around lack of
certain profiling support.  However this leaves a "WARNING" in the
testsuite results because while the compilation gets an expected
error, the testsuite warns about the executable not being produced.
E.g. see gcc.dg/nest.c in:
http://gcc.gnu.org/ml/gcc-testresults/2004-02/msg00702.html

It made more sense to use the testsuite's check for profiling
availability to mark the tests unsupported if possible.  The solaris2
case is quirky because we can do -pg but not -p.

So I modified the testsuite's check_profiling_available function to
accept an argument which describes the profiling test type (-p vs -pg)
and updated the three profiling tests accordingly.  Since it is
possible that irix6 may one day support -pg, I also used the explicit
type check there rather than declare it doesn't support profiling at
all and moved the associated comments inside the testsuite lib code.

Tested via "make check" on sparc-sun-solaris2 and mips-sgi-irix6.5.  I
examined the testsuite .log files to ensure it did the right thing in
each case.

Ok for mainline and 3.4?

		Thanks,
		--Kaveh


2004-02-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* lib/gcc-dg.exp (dg-require-profiling): Pass argument to
	check_profiling_available.
	* lib/target-supports.exp (check_profiling_available): Also check
	argument to determine whether we support profiling
	* g++.old-deja/g++.law/profile1.C: Pass profiling type to
	dg-require-profiling and delete special error handling.
	* gcc.dg/20021014-1.c: Likewise.
	* gcc.dg/nest.c: Likewise.
	
diff -rup orig/egcc-CVS20040214/gcc/testsuite/lib/gcc-dg.exp egcc-CVS20040214/gcc/testsuite/lib/gcc-dg.exp
--- orig/egcc-CVS20040214/gcc/testsuite/lib/gcc-dg.exp	2003-12-23 20:02:45.000000000 -0500
+++ egcc-CVS20040214/gcc/testsuite/lib/gcc-dg.exp	2004-02-15 11:28:42.303152007 -0500
@@ -324,7 +324,7 @@ 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 ] } {
+    if { ![ check_profiling_available ${args} ] } {
 	upvar dg-do-what dg-do-what
 	set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
 	return
diff -rup orig/egcc-CVS20040214/gcc/testsuite/lib/target-supports.exp egcc-CVS20040214/gcc/testsuite/lib/target-supports.exp
--- orig/egcc-CVS20040214/gcc/testsuite/lib/target-supports.exp	2004-02-05 20:03:55.000000000 -0500
+++ egcc-CVS20040214/gcc/testsuite/lib/target-supports.exp	2004-02-15 11:47:59.759914078 -0500
@@ -166,9 +166,32 @@ proc check_gc_sections_available { } {
 
 # Return true if profiling is supported on the target.
 
-proc check_profiling_available { } {
+proc check_profiling_available { test_what } {
     global profiling_available_saved
 
+    verbose "Profiling argument is <$test_what>" 1
+
+    # These conditions depend on the argument so examine them before
+    # looking at the cache variable.
+
+    # Support for -p on solaris2 relies on mcrt1.o which comes with the
+    # vendor compiler.  We cannot reiably predict the directory where the
+    # vendor compiler (and thus mcrt1.o) is installed so we can't
+    # necessarily find mcrt1.o even if we have it.
+    if { [istarget *-*-solaris2*] && [lindex $test_what 1] == "-p" } {
+	return 0
+    }
+
+    # Support for -p on irix relies on libprof1.a which doesn't appear to
+    # exist on any irix6 system currently posting testsuite results.
+    # 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
+    if { [istarget mips*-*-irix*] 
+    && ([lindex $test_what 1] == "-p" || [lindex $test_what 1] == "-pg") } {
+	return 0
+    }
+
+    # Now examine the cache variable.
     if {![info exists profiling_available_saved]} {
 	# Some targets don't have any implementation of __bb_init_func or are
 	# missing other needed machinery.
diff -rup orig/egcc-CVS20040214/gcc/testsuite/g++.old-deja/g++.law/profile1.C egcc-CVS20040214/gcc/testsuite/g++.old-deja/g++.law/profile1.C
--- orig/egcc-CVS20040214/gcc/testsuite/g++.old-deja/g++.law/profile1.C	2003-12-30 20:01:45.000000000 -0500
+++ egcc-CVS20040214/gcc/testsuite/g++.old-deja/g++.law/profile1.C	2004-02-15 10:52:58.206156946 -0500
@@ -1,5 +1,5 @@
-// { dg-do run { xfail mips*-*-* i[3456]86-*-sco3.2v5* } }
-// { dg-require-profiling "" }
+// { dg-do run { xfail i[3456]86-*-sco3.2v5* } }
+// { dg-require-profiling "-pg" }
 // { dg-options "-pg" }
 // { dg-options "-pg -static" { target hppa*-*-hpux* } }
 // GROUPS passed profiling
diff -rup orig/egcc-CVS20040214/gcc/testsuite/gcc.dg/20021014-1.c egcc-CVS20040214/gcc/testsuite/gcc.dg/20021014-1.c
--- orig/egcc-CVS20040214/gcc/testsuite/gcc.dg/20021014-1.c	2003-12-23 20:02:40.000000000 -0500
+++ egcc-CVS20040214/gcc/testsuite/gcc.dg/20021014-1.c	2004-02-15 10:55:13.734869276 -0500
@@ -1,17 +1,9 @@
 /* { dg-do run } */
-/* { dg-require-profiling "" } */
+/* { dg-require-profiling "-p" } */
 /* { dg-options "-O2 -p" } */
 /* { dg-options "-O2 -p -static" { target hppa*-*-hpux* } } */
 /* { 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
-   vendor compiler (and thus mcrt1.o) is installed so we can't
-   necessarily find mcrt1.o even if we have it.  */
-/* { dg-error "mcrt1.o" "Optional vendor profiler support missing" { target *-*-solaris2* } 0 } */
-/* Support for -p on irix relies on libprof1.a which doesn't appear to
-   exist on any irix6 system currently posting testsuite results.  */
-/* { dg-error "libprof1.a" "Profiler support missing" { target mips*-*-irix* } 0 } */
 
 extern void abort (void);
 extern void exit (int);
diff -rup orig/egcc-CVS20040214/gcc/testsuite/gcc.dg/nest.c egcc-CVS20040214/gcc/testsuite/gcc.dg/nest.c
--- orig/egcc-CVS20040214/gcc/testsuite/gcc.dg/nest.c	2003-12-23 20:02:40.000000000 -0500
+++ egcc-CVS20040214/gcc/testsuite/gcc.dg/nest.c	2004-02-15 10:54:26.228851724 -0500
@@ -1,12 +1,9 @@
 /* PR 5967, PR 7114 */
 /* { dg-do run } */
-/* { dg-require-profiling "" } */
+/* { dg-require-profiling "-pg" } */
 /* { dg-options "-O2 -pg" } */
 /* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */
 /* { 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 } */
 /* { dg-error "-pg not supported" "Profiler support missing" { target *-*-sco3.2v5* } 0 } */
 
 long foo (long x)


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