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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [special/] [unclaimed-category-1.m] - Blame information for rev 704

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* Contributed by Nicola Pero - Fri Dec 14 08:36:00 GMT 2001 */
2
/* { dg-do run } */
3
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
4
 
5
#include <objc/objc.h>
6
#include "../../objc-obj-c++-shared/runtime.h"
7
 
8
extern void abort (void);
9
 
10
/* Test loading unclaimed categories - categories of a class defined
11
   separately from the class itself.  */
12
 
13
 
14
/* unclaimed-category-1.m contains only the class definition but not
15
   the categories.  unclaimed-category-1a.m contains only the
16
   categories of the class, but not the class itself.  We want to
17
   check that the runtime can load the class from one module (file)
18
   and the categories from another module (file).  */
19
 
20
#include "unclaimed-category-1.h"
21
 
22
@implementation TestClass
23
- (int)D
24
{
25
  return 4;
26
}
27
+ initialize { return self; }
28
@end
29
 
30
 
31
int main (void)
32
{
33
  TestClass *test;
34
  Class testClass;
35
 
36
  testClass = objc_getClass ("TestClass");
37
  if (testClass == Nil)
38
    {
39
      abort ();
40
    }
41
 
42
  test = (TestClass *)(class_createInstance (testClass, 0));
43
  if (test == nil)
44
    {
45
      abort ();
46
    }
47
 
48
  if ([test A] != 1)
49
    {
50
      abort ();
51
    }
52
 
53
  if ([test B] != 2)
54
    {
55
      abort ();
56
    }
57
 
58
  if ([test C] != 3)
59
    {
60
      abort ();
61
    }
62
 
63
 
64
  if ([test D] != 4)
65
    {
66
      abort ();
67
    }
68
 
69
  return 0;
70
}

powered by: WebSVN 2.1.0

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