Debian Codegraph @

gcc/testsuite/objc.dg/special/load-category-3a.m

raw
1 /* Contributed by Nicola Pero <[email protected]>, December 2010. */
2
3 /* This test is identical to load-category-2, but the classes and
4 categories are created in inverted order in the modules, to test
5 that you can load classes first, or categories first, and it all
6 still works. */
7
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <objc/objc.h>
11
12 #include "load-category-3.h"
13
14 @implementation TestClass2
15 + load
16 {
17 printf ("[TestClass2 +load]\n");
18 /* Check superclasses/subclasses +load order. */
19 check_that_load_step_was_completed (0);
20 check_that_load_step_was_not_completed (1);
21 check_that_load_step_was_not_completed (2);
22
23 /* Check that the corresponding category's +load was not done. */
24 check_that_load_step_was_not_completed (4);
25
26 complete_load_step (1);
27 }
28 @end
29
30 @implementation TestClass3
31 + load
32 {
33 printf ("[TestClass3 +load]\n");
34
35 /* Check superclasses/subclasses +load order. */
36 check_that_load_step_was_completed (0);
37 check_that_load_step_was_completed (1);
38 check_that_load_step_was_not_completed (2);
39
40 /* Check that the corresponding category's +load was not done. */
41 check_that_load_step_was_not_completed (5);
42
43 complete_load_step (2);
44 }
45 @end
46
47 @implementation TestClass1
48 + initialize { return self; }
49 + load
50 {
51 printf ("[TestClass1 +load]\n");
52
53 /* Check superclasses/subclasses +load order. */
54 check_that_load_step_was_not_completed (0);
55 check_that_load_step_was_not_completed (1);
56 check_that_load_step_was_not_completed (2);
57
58 /* Check that the corresponding category's +load was not done. */
59 check_that_load_step_was_not_completed (3);
60
61 complete_load_step (0);
62 }
63 @end
64
65