Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / objc / execute / load-2.m
blobeb90658367e35e9bf0e809d9597537a6245fdb9d
1 /* Contributed by Nicola Pero - Wed Jun  6 14:34:23 CEST 2001 */
2 #include <objc/objc.h>
4 /* Test that +load is automatically called before main is run;
5    on two different classes. */
7 static int static_variable1 = 0;
8 static int static_variable2 = 0;
10 @interface TestClass1
12   Class isa;
14 + (void) load;
15 @end
17 @implementation TestClass1
18 + (void) load
20   static_variable1 = 1;
22 @end
24 @interface TestClass2
26   Class isa;
28 + (void) load;
29 @end
31 @implementation TestClass2
32 + (void) load
34   static_variable2 = 1;
36 @end
38 int main (void)
40   if (static_variable1 != 1  ||  static_variable2 != 1)
41     {
42       abort ();
43     }
45   return 0;