2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.ext / restrict1.C
blob0904eb690f3a6a8b2c6e5fbf44207ab9bd993daa
1 // { dg-do assemble  }
3 // Copyright (C) 1999 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 14 Nov 1999 <nathan@acm.org>
5 // Test our restrict object pointer extension
7 struct A
9   void f1() __restrict__;
10   void g1(int *__restrict__);
11   void f2() __restrict__;
12   void g2(int *__restrict__);
13   void f3();
14   void g3(int *);
15   void f4();
16   void g4(int *);
19 void A::f1 () __restrict__ {}
20 void A::g1 (int *__restrict__) {}
22 void A::f2 () {}
23 void A::g2 (int *) {}
25 void A::f3 () __restrict__ {}
26 void A::g3 (int *__restrict__) {}
28 void A::f4 () {}
29 void A::g4 (int *) {}
31 template <class T> struct X
33   void f1() __restrict__;
34   void g1(int *__restrict__);
35   void f2() __restrict__;
36   void g2(int *__restrict__);
37   void f3();
38   void g3(int *);
39   void f4();
40   void g4(int *);
43 template <class T> void X<T>::f1 () __restrict__ {}
44 template <class T> void X<T>::g1 (int *__restrict__) {}
45 template <class T> void X<T>::f2 () {}
46 template <class T> void X<T>::g2 (int *) {}
47 template <class T> void X<T>::f3 () __restrict__ {}
48 template <class T> void X<T>::g3 (int *__restrict__) {}
49 template <class T> void X<T>::f4 () {}
50 template <class T> void X<T>::g4 (int *) {}
52 void fn ()
54   X<int> g;
55   
56   g.f1 ();
57   g.f2 ();
58   g.f3 ();
59   g.f4 ();