| 1 |
/* Very simple root class for writing testcases. |
| 2 |
Copyright (C) 2011-2025 Free Software Foundation, Inc. |
| 3 |
Contributed by Nicola Pero |
| 4 |
|
| 5 |
This file is part of GCC. |
| 6 |
|
| 7 |
GCC is free software; you can redistribute it and/or modify |
| 8 |
it under the terms of the GNU General Public License as published by |
| 9 |
the Free Software Foundation; either version 3, or (at your option) |
| 10 |
any later version. |
| 11 |
|
| 12 |
GCC is distributed in the hope that it will be useful, |
| 13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
GNU General Public License for more details. |
| 16 |
|
| 17 |
You should have received a copy of the GNU General Public License |
| 18 |
along with GCC; see the file COPYING3. If not see |
| 19 |
<http://www.gnu.org/licenses/>. */ |
| 20 |
|
| 21 |
/* This is the implementation, but in all simple testcases we |
| 22 |
recommend simply including it in the testcase. */ |
| 23 |
|
| 24 |
#include "TestsuiteObject.h" |
| 25 |
#include "runtime.h" |
| 26 |
|
| 27 |
@implementation TestsuiteObject |
| 28 |
+ (id) initialize |
| 29 |
{ |
| 30 |
return self; |
| 31 |
} |
| 32 |
+ (id) new |
| 33 |
{ |
| 34 |
return [[self alloc] init]; |
| 35 |
} |
| 36 |
+ (id) alloc |
| 37 |
{ |
| 38 |
return class_createInstance (self, 0); |
| 39 |
} |
| 40 |
- (id) init |
| 41 |
{ |
| 42 |
return self; |
| 43 |
} |
| 44 |
/* We return 'id' to have the same signature as [Object -free] in |
| 45 |
older runtimes and avoid warnings about conflicting signatures. */ |
| 46 |
- (id) free |
| 47 |
{ |
| 48 |
/* Cast 'self' to 'id' because the NeXT runtime in darwin8 (Apple |
| 49 |
Mac OS X 10.4) declares object_dispose to take an "Object *" |
| 50 |
argument. */ |
| 51 |
return object_dispose ((id)self); |
| 52 |
} |
| 53 |
+ (Class) class |
| 54 |
{ |
| 55 |
return self; |
| 56 |
} |
| 57 |
+ (Class) superclass |
| 58 |
{ |
| 59 |
return class_getSuperclass (self); |
| 60 |
} |
| 61 |
+ (const char *)name |
| 62 |
{ |
| 63 |
return class_getName (self); |
| 64 |
} |
| 65 |
- (const char *)name |
| 66 |
{ |
| 67 |
return object_getClassName (self); |
| 68 |
} |
| 69 |
|
| 70 |
- (id) retain |
| 71 |
{ |
| 72 |
return self; |
| 73 |
} |
| 74 |
|
| 75 |
- (void) release |
| 76 |
{ |
| 77 |
return; |
| 78 |
} |
| 79 |
|
| 80 |
@end |