summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver/objc/objc-hi.m
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/driver/objc/objc-hi.m')
-rw-r--r--testsuite/tests/driver/objc/objc-hi.m35
1 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/tests/driver/objc/objc-hi.m b/testsuite/tests/driver/objc/objc-hi.m
new file mode 100644
index 0000000000..4580bd2dfb
--- /dev/null
+++ b/testsuite/tests/driver/objc/objc-hi.m
@@ -0,0 +1,35 @@
+#import <Foundation/Foundation.h>
+#import <stdio.h>
+
+@interface HelloWorld : NSObject {
+ // no instance variables
+}
+
+// methods
+- (void)sayHello;
+
+@end
+
+@implementation HelloWorld
+
+- (void)sayHello
+{
+ printf("Hello world\n");
+}
+
+@end
+
+#import <Foundation/Foundation.h>
+
+int main (int argc, const char * argv[]) {
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+
+ // my stuff
+ HelloWorld *hw = [[HelloWorld alloc] init];
+ [hw autorelease];
+
+ [hw sayHello];
+
+ [pool release];
+ return 0;
+}