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.m18
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/testsuite/objc/execute/exceptions/trivial.m b/gcc/testsuite/objc/execute/exceptions/trivial.m
index f1dce2c1e2b..4e55e9d841b 100644
--- a/gcc/testsuite/objc/execute/exceptions/trivial.m
+++ b/gcc/testsuite/objc/execute/exceptions/trivial.m
@@ -1,7 +1,19 @@
-#import <objc/Object.h>
+#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)
{
- [Object class];
- return 0;
+ @try {
+ int a = 1 ;
+ @throw [Object new];
+ }
+ @catch (Object *obj) {
+ return 0;
+ }
+ abort();
}
+
+#import "../../../objc-obj-c++-shared/Object1-implementation.h"