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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [obj-c++.dg/] [defs.mm] - Blame information for rev 823

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

Line No. Rev Author Line
1 149 jeremybenn
/* Check @defs() in Objective-C++ */
2
/* Contributed by Devang Patel    */
3
 
4
/* { dg-options "-lobjc" } */
5
/* { dg-do run } */
6
 
7
#include 
8
#include 
9
#include 
10
 
11
extern void abort(void);
12
 
13
@interface A : Object
14
{
15
  @public
16
    int a;
17
}
18
@end
19
 
20
struct A_defs
21
{
22
  @defs(A);
23
};
24
 
25
@implementation A
26
- init
27
{
28
  a = 42;
29
  return self;
30
}
31
@end
32
 
33
 
34
int main()
35
{
36
  A *a = [A init];
37
  struct A_defs *a_defs = (struct A_defs *)a;
38
 
39
  if (a->a != a_defs->a)
40
    abort ();
41
 
42
  return 0;
43
}

powered by: WebSVN 2.1.0

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