mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
902d580bd9
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
26 lines
336 B
C++
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;
|
|
}
|