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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc.dg/] [special/] [unclaimed-category-1.m] - Blame information for rev 316

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

Line No. Rev Author Line
1 309 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
#import "../../objc-obj-c++-shared/next-mapping.h"
6
#include <objc/objc.h>
7
#ifndef __NEXT_RUNTIME__
8
#include <objc/objc-api.h>
9
#endif
10
 
11
extern void abort (void);
12
 
13
/* Test loading unclaimed categories - categories of a class defined
14
   separately from the class itself.  */
15
 
16
 
17
/* unclaimed-category-1.m contains only the class definition but not
18
   the categories.  unclaimed-category-1a.m contains only the
19
   categories of the class, but not the class itself.  We want to
20
   check that the runtime can load the class from one module (file)
21
   and the categories from another module (file).  */
22
 
23
#include "unclaimed-category-1.h"
24
 
25
@implementation TestClass
26
- (int)D
27
{
28
  return 4;
29
}
30
#ifdef __NEXT_RUNTIME__                                   
31
+ initialize { return self; }
32
#endif
33
@end
34
 
35
 
36
int main (void)
37
{
38
  TestClass *test;
39
  Class testClass;
40
 
41
  testClass = objc_get_class ("TestClass");
42
  if (testClass == Nil)
43
    {
44
      abort ();
45
    }
46
 
47
  test = (TestClass *)(class_create_instance (testClass));
48
  if (test == nil)
49
    {
50
      abort ();
51
    }
52
 
53
  if ([test A] != 1)
54
    {
55
      abort ();
56
    }
57
 
58
  if ([test B] != 2)
59
    {
60
      abort ();
61
    }
62
 
63
  if ([test C] != 3)
64
    {
65
      abort ();
66
    }
67
 
68
 
69
  if ([test D] != 4)
70
    {
71
      abort ();
72
    }
73
 
74
  return 0;
75
}
76
 
77
#import "../../objc-obj-c++-shared/Object1-implementation.h"

powered by: WebSVN 2.1.0

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