Reset branch to trunk.
[official-gcc.git] / trunk / gcc / testsuite / objc / execute / no_clash.m
blob7eaa5130727977ac74eff9d471a453dd5b2ea2de
1 /* Contributed by Nicola Pero - Fri Mar  9 19:39:15 CET 2001 */
2 #include <objc/objc.h>
3 #include <objc/Object.h>
5 /* Test that using the same name for different things makes no 
6    problem */
8 @interface TestClass : Object
10   int test;
12 + (int) test;
13 - (int) test;
14 @end
16 @implementation TestClass
17 + (int) test
19   return 1;
21 - (int) test
23   /* 0 + 2 as `test' is implicitly initialized to zero */
24   return test + 2; 
26 @end
29 int main (void)
31   if ([TestClass test] != 1)
32     {
33       abort ();
34     }
35   if ([[[TestClass alloc] init] test] != 2)
36     {
37       abort ();
38     }
40   return 0;