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]

Re: Patch g++.dg/cdce3.C test for IA64 HP-UX


Here is a new patch to fix g++.dg/cdce3.C test on IA64 HP-UX and any
other platform that doesn't have pow10.  It doesn't address the
problem freebsd has with the *l functions but presumably we could
fix those the same way with a different check_effective routine.

Tested on IA64 HP-UX and Linux.

OK for checkin?



2008-09-22  Steve Ellcey  <sje@cup.hp.com>

	* lib/target-supports.exp (check_effective_target_pow10): New.
	* g++.dg/cdce3.C: Set NO_GNU_EXTENSION if !pow10.


Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 140538)
+++ lib/target-supports.exp	(working copy)
@@ -2612,3 +2612,16 @@ proc check_effective_target_wchar_t_char
         char t[(((__CHAR32_TYPE__) -1) < 0 == ((__WCHAR_TYPE__) -1) <
0) ? 1 : -1];
     }]
 }
+
+# Return 1 if pow10 function exists.
+
+proc check_effective_target_pow10 { } {
+    return [check_runtime pow10 {
+	#include <math.h>
+	int main () {
+	double x;
+	x = pow10 (1);
+	return 0;
+	}
+    } "-lm" ]
+}
Index: g++.dg/cdce3.C
===================================================================
--- g++.dg/cdce3.C	(revision 140538)
+++ g++.dg/cdce3.C	(working copy)
@@ -1,10 +1,10 @@
 /* { dg-do run } */
 /* { dg-require-effective-target c99_runtime } */
-/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details
-DNO_GNU_EXTENSION -lm" { target "*-*-darwin*" } } */
-/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details
-lm" { target { {! "*-*-darwin*" } && large_long_double } } }*/
+/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details
-DNO_GNU_EXTENSION -lm" { target {! pow10 } } } */
+/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details
-lm" { target { pow10 && large_long_double } } } */
 /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details
-DNO_LONG_DOUBLE -lm" { target {! large_long_double } } } */
-/* { dg-final { scan-tree-dump  "cdce3.C:90: note: function call is
shrink-wrapped into error conditions\." "cdce" { target {!
"*-*-darwin*" } } } }*/
-/* { dg-final { scan-tree-dump  "cdce3.C:91: note: function call is
shrink-wrapped into error conditions\." "cdce" { target {!
"*-*-darwin*" } } } }*/
+/* { dg-final { scan-tree-dump  "cdce3.C:90: note: function call is
shrink-wrapped into error conditions\." "cdce" { target { pow10 } } } }
*/
+/* { dg-final { scan-tree-dump  "cdce3.C:91: note: function call is
shrink-wrapped into error conditions\." "cdce" { target { pow10 } } } }
*/
 /* { dg-final { scan-tree-dump  "cdce3.C:93: note: function call is
shrink-wrapped into error conditions\." "cdce" } }*/
 /* { dg-final { scan-tree-dump  "cdce3.C:94: note: function call is
shrink-wrapped into error conditions\." "cdce" } }*/
 /* { dg-final { scan-tree-dump  "cdce3.C:95: note: function call is
shrink-wrapped into error conditions\." "cdce" } }*/



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