Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / toolchain / eh_virtual_dtor.cc
1 /*
2  * Copyright 2010 The Native Client Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  */
6
7 #include "native_client/tests/toolchain/eh_helper.h"
8
9 class C {
10  public:
11   C() { next_step(4); }
12   virtual ~C() { next_step(5); }
13 };
14
15
16 void tryit() {
17   next_step(3);
18   C c;
19   throw 666;
20   abort();
21 }
22
23
24 int main() {
25   next_step(1);
26   try {
27     next_step(2);
28     tryit();
29   } catch(int x) {
30     next_step(6);
31     if (x != 666) abort();
32   }
33
34   next_step(7);
35   return 55;
36 }