summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/special/load-category-2a.m
blob: 6b81240dbe97b6d854e86d43fdb98f884cb8d7fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010.  */

#include <stdio.h>
#include <stdlib.h>
#include <objc/objc.h>

#include "load-category-2.h"

/* Compile the categories in random order to prevent the runtime from
   sending +load in the correct order just because the classes happen
   to have been compiled in that order.  */
@implementation TestClass2 (Category)
+ load
{
  printf ("[TestClass2(Category) +load]\n");

  /* Check that the corresponding class's +load was done.  */
  check_that_load_step_was_completed (1);

  complete_load_step (4);
}
@end

@implementation TestClass3 (Category)
+ load
{
  printf ("[TestClass3(Category) +load]\n");

  /* Check that the corresponding class's +load was done.  */
  check_that_load_step_was_completed (2);

  complete_load_step (5);
}
@end

@implementation TestClass1 (Category)
+ load
{
  printf ("[TestClass1(Category) +load]\n");

  /* Check that the corresponding class's +load was done.  */
  check_that_load_step_was_completed (0);

  complete_load_step (3);
}
@end