This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Testsuite tweaks
- From: Mark Mitchell <mark at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 27 Aug 2003 09:57:09 -0700
- Subject: PATCH: Testsuite tweaks
- Reply-to: mark at codesourcery dot com
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; }