PATCH: Testsuite tweaks

Mark Mitchell mark@codesourcery.com
Wed Aug 27 17:01:00 GMT 2003


This patch adds ptrmem3.C (which tests for an optimization bug
involving pointers to members that we no longer have, after my
reworking of the internal representation).

It also removes the XFAIL on overload8.C, which I fixed last week.

Tested on i686-pc-linux-gnu, applied on the mainline.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2003-08-27  Mark Mitchell  <mark@codesourcery.com>

	* g++.dg/opt/ptrmem3.C: New test.

	* g++.old-deja/g++.pt/overload8.C: Remove XFAIL.

Index: testsuite/g++.dg/opt/ptrmem3.C
===================================================================
RCS file: testsuite/g++.dg/opt/ptrmem3.C
diff -N testsuite/g++.dg/opt/ptrmem3.C
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/g++.dg/opt/ptrmem3.C	27 Aug 2003 16:20:54 -0000
***************
*** 0 ****
--- 1,23 ----
+ // { dg-options "-O1" }
+ 
+ #include <stdio.h>
+ struct A {
+      A(int arg) : ia(arg) {}
+      int x,y,z,ia;
+      int mf(int arg) { return arg + ia; }
+ };
+ int func(int A::*pdm, int (A::*pmf)(int)) //      2.      regular function
+ { 
+      A oa(2);
+      return ((&oa)->*pdm) + (oa.*pmf)(2); 
+ }       
+ int main()
+ {
+      int val;
+ 
+      int A::*pda = &A::ia;           
+      int (A::*pmfa)(int) = &A::mf;   
+      val = func( pda, pmfa );
+      if(val != 6)
+        printf("val=%d, expect 6 \n", val);
+ }
Index: testsuite/g++.old-deja/g++.pt/overload8.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.pt/overload8.C,v
retrieving revision 1.3
diff -c -5 -p -r1.3 overload8.C
*** testsuite/g++.old-deja/g++.pt/overload8.C	1 May 2003 02:02:55 -0000	1.3
--- testsuite/g++.old-deja/g++.pt/overload8.C	27 Aug 2003 16:20:54 -0000
***************
*** 5,12 ****
  struct baz;
  
  void operator*(baz&, double);
  
  template <class T> inline T operator*(double s, const T &p)
!   ; // { dg-bogus "" "" { xfail *-*-* } }  - must have argument of class type - 
  
  void m(baz& a) { a * .5; }
--- 5,12 ----
  struct baz;
  
  void operator*(baz&, double);
  
  template <class T> inline T operator*(double s, const T &p)
!   ; // { dg-bogus "" "" }  - must have argument of class type - 
  
  void m(baz& a) { a * .5; }



More information about the Gcc-patches mailing list