aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/gcc/testsuite/obj-c++.dg/gnu-runtime-3.mm
blob: d9c62d9de2d3de7ed21677d09a2ae6c738b39257 (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
/* Test that compiling for the GNU runtime works (regardless of
   the system runtime used).  */
/* Author: Ziemowit Laski <zlaski@apple.com>  */
/* { dg-do run } */
/* { dg-options "-fgnu-runtime" } */

#include <objc/Object.h>
#include <stdlib.h>

@interface FooBar: Object
- (void)boo;
@end

int called = 0;

@implementation FooBar
- (void)boo
{
  called ++;
}
@end

int main ()
{
  id fooBarInst = [[FooBar alloc] init];
  [fooBarInst boo];
  if (called != 1)
    abort ();
  return 0;
}