summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/driver/objc/objc-hi.m
blob: 4580bd2dfbc30302b7c63683009fd7f531813085 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;
}