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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [defs.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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