diff options
author | Ian Lynagh <igloo@earth.li> | 2011-08-06 14:51:09 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-08-06 14:51:09 +0100 |
commit | 6f663a6488ae83e5dbe20ad5a5272549807dab45 (patch) | |
tree | c36ede7c0de3316a8714d82f99353b63f749862a /testsuite/tests/driver/objc | |
parent | 5b5294f40a52ab764ecde6e3c1b8a3d4f32186d4 (diff) | |
download | haskell-6f663a6488ae83e5dbe20ad5a5272549807dab45.tar.gz |
Move objcpp-hi files out of ghc-regress/
Diffstat (limited to 'testsuite/tests/driver/objc')
-rw-r--r-- | testsuite/tests/driver/objc/objcpp-hi.mm | 35 | ||||
-rw-r--r-- | testsuite/tests/driver/objc/objcpp-hi.stdout | 1 |
2 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/tests/driver/objc/objcpp-hi.mm b/testsuite/tests/driver/objc/objcpp-hi.mm new file mode 100644 index 0000000000..7a4f1011d3 --- /dev/null +++ b/testsuite/tests/driver/objc/objcpp-hi.mm @@ -0,0 +1,35 @@ +#import <Foundation/Foundation.h> +#import <iostream> + +@interface HelloWorld : NSObject { + // no instance variables +} + +// methods +- (void)sayHello; + +@end + +@implementation HelloWorld + +- (void)sayHello +{ + std::cout << "Hello world" << std::endl; +} + +@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/objcpp-hi.stdout b/testsuite/tests/driver/objc/objcpp-hi.stdout new file mode 100644 index 0000000000..802992c422 --- /dev/null +++ b/testsuite/tests/driver/objc/objcpp-hi.stdout @@ -0,0 +1 @@ +Hello world |