llvm-6502/test/C++Frontend/EH/simple_rethrow.cpp
Chris Lattner 902d580bd9 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
2003-08-28 19:57:53 +00:00

26 lines
336 B
C++

#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;
}