summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc/execute/function-message-1.m
blob: 6f4d879201a8603f882d236fc219b755dc51c11b (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
#import "../../objc-obj-c++-shared/Object1.h"

@interface Foo : Object
+ bar;
@end

int foocalled = 0;
int barcalled = 0;


id foo()
{
    if (foocalled)
      abort ();
    foocalled = 1;
    return [Foo class];
}

@implementation Foo
+ bar
{
    if (barcalled)
      abort ();
    barcalled = 1;
    return self;
}
@end

int main(int argc,char **argv)
{
    [foo() bar];
    return 0;
}