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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc.dg/] [sizeof-1.m] - Blame information for rev 859

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

Line No. Rev Author Line
1 309 jeremybenn
/* Check that the sizeof() operator works with ObjC classes and their aliases. */
2
/* Contributed by Ziemowit Laski <zlaski@apple.com>.  */
3
/* { dg-options "" } */
4
/* { dg-do run } */
5
 
6
#include "../objc-obj-c++-shared/Object1.h"
7
#include <objc/objc.h>
8
 
9
extern void abort(void);
10
#define CHECK_IF(expr) if(!(expr)) abort();
11
 
12
@interface Foo: Object {
13
  int a, b;
14
  float c, d;
15
}
16
@end
17
 
18
@implementation Foo
19
@end
20
 
21
typedef Object MyObject;
22
typedef struct Foo Foo_type;
23
 
24
@compatibility_alias AliasObject Object;
25
 
26
int main(void) {
27
  CHECK_IF(sizeof(Foo) > sizeof(Object) && sizeof(Object) > 0);
28
  CHECK_IF(sizeof(Foo) == sizeof(Foo_type));
29
  CHECK_IF(sizeof(Object) == sizeof(MyObject));
30
  CHECK_IF(sizeof(Object) == sizeof(AliasObject));
31
  return 0;
32
}
33
 
34
#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.