Wattributes-10.c: Add -fno-common option on hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.eh / ptr1.C
blobaefe5cc618ed7be009344599d2b4b240b12ae08a
1 // { dg-do run  }
2 // Bug: catching pointers by reference doesn't work right.
4 extern "C" int printf (const char *, ...);
6 struct E {
7   int x;
8   E(int i) { x = i; }
9 };
11 int main()
13   try {
14     E *p = new E(5);
15     throw p;
16   }
18   catch (E *&e) {
19     printf ("address of e is 0x%lx\n", (__SIZE_TYPE__)e);
20     return !((__SIZE_TYPE__)e != 5 && e->x == 5);
21   }
22   return 2;