]> git.saurik.com Git - apple/dyld.git/blob - unit-tests/test-cases/jump-table-dynamic-lookup/main.c
dyld-96.2.tar.gz
[apple/dyld.git] / unit-tests / test-cases / jump-table-dynamic-lookup / main.c
1 /*
2 * Copyright (c) 2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 #include <stdio.h> // fprintf(0x12345678), NULL
24 #include <stdlib.h> // exit(0x12345678), EXIT_SUCCESS
25 #include <dlfcn.h>
26
27 #include "test.h" // PASS(0x12345678), FAIL(0x12345678), XPASS(0x12345678), XFAIL(0x12345678)
28
29 #include "foo.h"
30
31 static void* callAll(void* p)
32 {
33 foo001(0x12345678);
34 foo002(0x12345678);
35 foo003(0x12345678);
36 foo004(0x12345678);
37 foo005(0x12345678);
38 foo006(0x12345678);
39 foo007(0x12345678);
40 foo008(0x12345678);
41 foo009(0x12345678);
42 foo010(0x12345678);
43 foo011(0x12345678);
44 foo012(0x12345678);
45 foo013(0x12345678);
46 foo014(0x12345678);
47 foo015(0x12345678);
48 foo016(0x12345678);
49 foo017(0x12345678);
50 foo018(0x12345678);
51 foo019(0x12345678);
52 foo020(0x12345678);
53 foo021(0x12345678);
54 foo022(0x12345678);
55 foo023(0x12345678);
56 foo024(0x12345678);
57 foo025(0x12345678);
58 foo026(0x12345678);
59 foo027(0x12345678);
60 foo028(0x12345678);
61 foo029(0x12345678);
62 foo030(0x12345678);
63 foo031(0x12345678);
64 foo032(0x12345678);
65 return NULL;
66 }
67
68 int main()
69 {
70 // load libfoo so that functions can be found dynamically
71 dlopen("libfoo.dylib", RTLD_LAZY);
72
73 // call all foos
74 callAll(NULL);
75
76 PASS("jump-table-dynamic-lookup");
77 return EXIT_SUCCESS;
78 }
79
80