Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.ext/restrict1.C

raw
1 // { dg-do assemble }
2
3 // Copyright (C) 1999 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 14 Nov 1999 <[email protected]>
5 // Test our restrict object pointer extension
6
7 struct A
8 {
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 *);
17 };
18
19 void A::f1 () __restrict__ {}
20 void A::g1 (int *__restrict__) {}
21
22 void A::f2 () {}
23 void A::g2 (int *) {}
24
25 void A::f3 () __restrict__ {}
26 void A::g3 (int *__restrict__) {}
27
28 void A::f4 () {}
29 void A::g4 (int *) {}
30
31 template <class T> struct X
32 {
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 *);
41 };
42
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 *) {}
51
52 void fn ()
53 {
54 X<int> g;
55
56 g.f1 ();
57 g.f2 ();
58 g.f3 ();
59 g.f4 ();
60 }