~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tests/core/test_exception_2.in

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-02-05 18:46:19 UTC
  • mfrom: (4.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140205184619-bmxq31rw0cd3ar4u
Tags: 1.10.0~20140205~ef1e460-1
* New snapshot release
* Also install cmake / emscripten files. Thanks to Daniele Di Proietto
  for the patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <stdexcept>
2
 
#include <stdio.h>
3
 
 
4
 
typedef void (*FuncPtr)();
5
 
 
6
 
void ThrowException() { throw std::runtime_error("catch me!"); }
7
 
 
8
 
FuncPtr ptr = ThrowException;
9
 
 
10
 
int main() {
11
 
  try {
12
 
    ptr();
13
 
  }
14
 
  catch (...) {
15
 
    printf("Exception caught successfully!\n");
16
 
  }
17
 
  return 0;
18
 
}