Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / toolchain / eh_loop_single.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 int N = 10;
10
11 int main() {
12   int i = -1;
13   next_step(1);
14   try {
15     next_step(2);
16     for (i = 0; i < N; ++i) {
17       printf("iteration: %d\n", i);
18       next_step(3);
19       throw(666);
20       abort();
21     }
22     abort();
23   } catch(int x) {
24     if (x != 666) abort();
25     next_step(4);
26     if (i != 0) abort();
27     return 55;
28   }
29
30   return -1;
31 }