diff options
author | Chris Lattner <sabre@nondot.org> | 2003-08-28 19:57:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-08-28 19:57:53 +0000 |
commit | 902d580bd9e594d1d8fe2df05513123ac0f0f45d (patch) | |
tree | cfb4f6584393e3510a859033bf5977cd8c1a29b7 /test/C++Frontend/EH/simple_rethrow.cpp | |
parent | 8df6bddd01355cdf3dcb26099f3a4eff5e9281bb (diff) |
New testcases, all of which work with llvmg++!
This tests exception specifications, and also adds an "easy" rethrow test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8183 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/C++Frontend/EH/simple_rethrow.cpp')
-rw-r--r-- | test/C++Frontend/EH/simple_rethrow.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/C++Frontend/EH/simple_rethrow.cpp b/test/C++Frontend/EH/simple_rethrow.cpp new file mode 100644 index 0000000000..34c46812c1 --- /dev/null +++ b/test/C++Frontend/EH/simple_rethrow.cpp @@ -0,0 +1,25 @@ +#include <stdio.h> + +int throws() { + printf("Throwing int\n"); + throw 16; +}; + +int callsthrows() { + try { + throws(); + } catch (...) { + printf("Caught something, rethrowing...\n"); + throw; + } +} + +int main() { + try { + callsthrows(); + } catch (int i) { + printf("Caught int: %d\n", i); + return i-16; + } + return 1; +} |