]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / objc-obj-c++-shared / TestsuiteObject.m
CommitLineData
5bceb3cd 1/* Very simple root class for writing testcases.
f1717362 2 Copyright (C) 2011-2016 Free Software Foundation, Inc.
5bceb3cd 3 Contributed by Nicola Pero
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 3, or (at your option)
10any later version.
11
12GCC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along 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}
70b94c2c 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
5bceb3cd 47{
70b94c2c 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);
5bceb3cd 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 class_getName (isa);
68}
69@end