d: Fix gdc -O2 -mavx generates misaligned vmovdqa instruction [PR114171]
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / template3.C
blob09c8571871a38915d2bda975fb05cff45db2b01f
1 // { dg-do run  }
2 // GROUPS passed templates
3 extern "C" int printf (const char *, ...);
4 extern "C" void exit (int);
6 int count = 0;
8 void
9 die (int x)
11   if (x != ++count)
12     {
13       printf ("FAIL\n");
14       exit (1);
15     }
18 class A {
19   public:
20     void   f() const { die (-1); }
24 template <class Item>
25 class B : public A {
26   public:
27   void f() const;
30 template <class Item>
31 inline void B<Item>::f() const { die (1); }
33 template <class Item>
34 class C : public A {
35   public:
36     void f() const { die (2); }
40 int main()
42     B<int> b;
43     C<int> c;
45     b.f(); //- bugged, (A::f() called instead of B::f())
46     c.f(); //- works fine (C::f() called)
48     printf ("PASS\n");
49     return 0;