summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver/objc
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/driver/objc')
-rw-r--r--testsuite/tests/driver/objc/Makefile4
-rw-r--r--testsuite/tests/driver/objc/all.T10
-rw-r--r--testsuite/tests/driver/objc/objc-hi.m35
-rw-r--r--testsuite/tests/driver/objc/objc-hi.stdout1
4 files changed, 50 insertions, 0 deletions
diff --git a/testsuite/tests/driver/objc/Makefile b/testsuite/tests/driver/objc/Makefile
new file mode 100644
index 0000000000..4a268530f1
--- /dev/null
+++ b/testsuite/tests/driver/objc/Makefile
@@ -0,0 +1,4 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
diff --git a/testsuite/tests/driver/objc/all.T b/testsuite/tests/driver/objc/all.T
new file mode 100644
index 0000000000..ee22934399
--- /dev/null
+++ b/testsuite/tests/driver/objc/all.T
@@ -0,0 +1,10 @@
+def if_not_platform(platforms, f):
+ if not (config.platform in platforms):
+ return f
+ else:
+ return normal
+
+skip_if_not_osx = if_not_platform(['i386-apple-darwin','x86_64-apple-darwin'], skip)
+
+test('objc-hi', [ skip_if_not_osx, objc_src ],
+ compile_and_run, ['-framework Foundation'])
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;
+}
diff --git a/testsuite/tests/driver/objc/objc-hi.stdout b/testsuite/tests/driver/objc/objc-hi.stdout
new file mode 100644
index 0000000000..802992c422
--- /dev/null
+++ b/testsuite/tests/driver/objc/objc-hi.stdout
@@ -0,0 +1 @@
+Hello world