summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc/execute/cascading-1.m
blob: b823ea816f0d8365e9395204df378b1c10d69036 (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
#include <stdlib.h>
#import "../../objc-obj-c++-shared/Object1.h"

@interface Foo : Object
+ foo;
+ bar;
@end

int foocalled = 0;
int barcalled = 0;


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

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