OSDN Git Service

4dd08d1e6b971bc35273909c8932434517c555dc
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / eh / weak1.C
1 // PR target/29487
2 // { dg-do run { xfail { hppa*-*-hpux* && { ! hppa*64*-*-* } } } }
3 // { dg-require-weak "" }
4 // { dg-additional-sources "weak1-a.cc" }
5 // { dg-options "-O2" }
6
7 extern __attribute__((weak)) 
8 void f() {
9 }
10
11 int main () {
12   try {
13     f();
14     return 1;
15   } catch (int i) {
16     /* Although the implementation of f in this file does not throw
17        any exceptions, it is weak, and may therefore be replaced at
18        link time.  Therefore, the compiler must not optimize away this
19        catch clause.  */
20     if (i != 7)
21       return 2;
22   }
23 }