OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc/] [execute/] [no_clash.m] - Blame information for rev 862

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 307 jeremybenn
/* Contributed by Nicola Pero - Fri Mar  9 19:39:15 CET 2001 */
2
#import "../../objc-obj-c++-shared/Object1.h"
3
#import <objc/objc.h>
4
 
5
/* Test that using the same name for different things makes no
6
   problem */
7
 
8
@interface TestClass : Object
9
{
10
  int test;
11
}
12
+ (int) test;
13
- (int) test;
14
@end
15
 
16
@implementation TestClass
17
+ (int) test
18
{
19
  return 1;
20
}
21
- (int) test
22
{
23
  /* 0 + 2 as `test' is implicitly initialized to zero */
24
  return test + 2;
25
}
26
@end
27
 
28
 
29
int main (void)
30
{
31
  if ([TestClass test] != 1)
32
    {
33
      abort ();
34
    }
35
  if ([[[TestClass alloc] init] test] != 2)
36
    {
37
      abort ();
38
    }
39
 
40
  return 0;
41
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.