[AArch64] Fix SVE testsuite failures for ILP32 (PR 83846)
[official-gcc.git] / gcc / testsuite / g++.dg / other / ptrmem1.C
blobfa9115e506c1e8fbad42edff8afab7e5027c8677
1 // { dg-do run }
3 // Copyright (C) 2001 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 31 Dec 2001 <nathan@codesourcery.com>
6 // PR 4379. We created pointers to member references and pointers to
7 // member fields when we shouldn't have.
9 int gs;
10 int gm;
12 struct D {
13   D () :m (gm) {}
14   
15   int &m;
16   static int &s;
17   
18   int Foo ();
21 int &D::s = gs;
23 template<class T> int f1(T x)
25   return x != &gm;
27 template<class T> int f2(T x) 
29   return x != &gs;
32 int D::Foo ()
34   int r;
35   
36   if (f1( &(D::m)))
37     return 3;
38   
39   if (f2( &D::s))
40     return 1;
41   if (f2( &(D::s)))
42     return 2;
43   return 0;
46 int Foo ()
48   if (f2( &D::s))
49     return 4;
50   if (f2( &(D::s)))
51     return 5;
52   return 0;
55 int main ()
57   D d;
58   int r = d.Foo ();
59   if (r)
60     return r;
61   r = Foo ();
62   if (r)
63     return r;
64   return 0;
65