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/] [obj-c++.dg/] [defs.mm] - Blame information for rev 316

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

Line No. Rev Author Line
1 308 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/Object1.h"
7
#include 
8
#include 
9
 
10
extern "C" void abort(void);
11
 
12
@interface A : Object
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
#include "../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.