summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc/execute/exceptions/trivial.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc/execute/exceptions/trivial.m')
-rw-r--r--gcc/testsuite/objc/execute/exceptions/trivial.m19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/objc/execute/exceptions/trivial.m b/gcc/testsuite/objc/execute/exceptions/trivial.m
new file mode 100644
index 000000000..4e55e9d84
--- /dev/null
+++ b/gcc/testsuite/objc/execute/exceptions/trivial.m
@@ -0,0 +1,19 @@
+#include <stdlib.h>
+#import "../../../objc-obj-c++-shared/Object1.h"
+
+/* do nothing except prove we can compile and link code calling the
+ ecceptions mechanism */
+
+int main(void)
+{
+ @try {
+ int a = 1 ;
+ @throw [Object new];
+ }
+ @catch (Object *obj) {
+ return 0;
+ }
+ abort();
+}
+
+#import "../../../objc-obj-c++-shared/Object1-implementation.h"