Clean up some minor white space issues in trans-decl.c and trans-expr.c
[official-gcc.git] / gcc / testsuite / objc / execute / class-12.m
blobd3116e8cc40426f9af4f5b466952b4d79ed4029c
1 /* Contributed by Nicola Pero - Tue Mar  6 23:05:53 CET 2001 */
3 #include <objc/objc.h>
5 /* Tests creating a root class and a subclass with a class methods */
7 @interface RootClass
9   Class isa;
11 @end
13 @implementation RootClass
14 + initialize { return self; }
15 @end
17 static int class_variable = 0;
19 @interface SubClass : RootClass
20 + (void) setState: (int)number;
21 + (int) state;
22 @end
24 @implementation SubClass
25 + (void) setState: (int)number
27   class_variable = number;
29 + (int) state
31   return class_variable;
33 @end
35 #include "class-tests-1.h"
36 #define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD Class
37 #include "class-tests-2.h"
39 int main (void)
41   Class class;
43   test_class_with_superclass ("SubClass", "RootClass");
44   test_that_class_has_class_method ("SubClass", @selector (setState:));
45   test_that_class_has_class_method ("SubClass", @selector (state));
47   class = objc_getClass ("SubClass");
48   test_accessor_method (class, 0, -1, -1, 1, 1);
50   return 0;