]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/launch-image-cache.dtest/main.c
dyld-851.27.tar.gz
[apple/dyld.git] / testing / test-cases / launch-image-cache.dtest / main.c
1
2 // BUILD: $CC foo1.c -dynamiclib -install_name $RUN_DIR/libfoo1.dylib -o $BUILD_DIR/libfoo1.dylib
3 // BUILD: $CC foo2.c -dynamiclib -install_name $RUN_DIR/libfoo2.dylib -o $BUILD_DIR/libfoo2.dylib
4 // BUILD: $CC foo3.c -dynamiclib -install_name $RUN_DIR/libfoo3.dylib -o $BUILD_DIR/libfoo3.dylib
5 // BUILD: $CC foo4.c -dynamiclib -install_name $RUN_DIR/libfoo4.dylib -o $BUILD_DIR/libfoo4.dylib
6 // BUILD: $CC foo5.c -dynamiclib -install_name $RUN_DIR/libfoo5.dylib -o $BUILD_DIR/libfoo5.dylib
7 // BUILD: $CC foo6.c -dynamiclib -install_name $RUN_DIR/libfoo6.dylib -o $BUILD_DIR/libfoo6.dylib
8 // BUILD: $CC foo7.c -dynamiclib -install_name $RUN_DIR/libfoo7.dylib -o $BUILD_DIR/libfoo7.dylib
9 // BUILD: $CC foo8.c -dynamiclib -install_name $RUN_DIR/libfoo8.dylib -o $BUILD_DIR/libfoo8.dylib
10 // BUILD: $CC foo9.c -dynamiclib -install_name $RUN_DIR/libfoo9.dylib -o $BUILD_DIR/libfoo9.dylib
11 // BUILD: $CC foo10.c -dynamiclib -install_name $RUN_DIR/libfoo10.dylib -o $BUILD_DIR/libfoo10.dylib
12 // BUILD: $CC foo11.c -dynamiclib -install_name $RUN_DIR/libfoo11.dylib -o $BUILD_DIR/libfoo11.dylib
13 // BUILD: $CC foo12.c -dynamiclib -install_name $RUN_DIR/libfoo12.dylib -o $BUILD_DIR/libfoo12.dylib
14 // BUILD: $CC foo13.c -dynamiclib -install_name $RUN_DIR/libfoo13.dylib -o $BUILD_DIR/libfoo13.dylib
15 // BUILD: $CC foo14.c -dynamiclib -install_name $RUN_DIR/libfoo14.dylib -o $BUILD_DIR/libfoo14.dylib
16 // BUILD: $CC foo15.c -dynamiclib -install_name $RUN_DIR/libfoo15.dylib -o $BUILD_DIR/libfoo15.dylib
17 // BUILD: $CC foo16.c -dynamiclib -install_name $RUN_DIR/libfoo16.dylib -o $BUILD_DIR/libfoo16.dylib
18 // BUILD: $CC foo17.c -dynamiclib -install_name $RUN_DIR/libfoo17.dylib -o $BUILD_DIR/libfoo17.dylib
19 // BUILD: $CC foo18.c -dynamiclib -install_name $RUN_DIR/libfoo18.dylib -o $BUILD_DIR/libfoo18.dylib
20 // BUILD: $CC foo19.c -dynamiclib -install_name $RUN_DIR/libfoo19.dylib -o $BUILD_DIR/libfoo19.dylib
21 // BUILD: $CC foo20.c -dynamiclib -install_name $RUN_DIR/libfoo20.dylib -o $BUILD_DIR/libfoo20.dylib
22 // BUILD: $CC foo21.c -dynamiclib -install_name $RUN_DIR/libfoo21.dylib -o $BUILD_DIR/libfoo21.dylib
23 // BUILD: $CC foo22.c -dynamiclib -install_name $RUN_DIR/libfoo22.dylib -o $BUILD_DIR/libfoo22.dylib
24 // BUILD: $CC foo23.c -dynamiclib -install_name $RUN_DIR/libfoo23.dylib -o $BUILD_DIR/libfoo23.dylib
25 // BUILD: $CC foo24.c -dynamiclib -install_name $RUN_DIR/libfoo24.dylib -o $BUILD_DIR/libfoo24.dylib
26 // BUILD: $CC foo25.c -dynamiclib -install_name $RUN_DIR/libfoo25.dylib -o $BUILD_DIR/libfoo25.dylib
27 // BUILD: $CC foo26.c -dynamiclib -install_name $RUN_DIR/libfoo26.dylib -o $BUILD_DIR/libfoo26.dylib
28 // BUILD: $CC foo27.c -dynamiclib -install_name $RUN_DIR/libfoo27.dylib -o $BUILD_DIR/libfoo27.dylib
29 // BUILD: $CC foo28.c -dynamiclib -install_name $RUN_DIR/libfoo28.dylib -o $BUILD_DIR/libfoo28.dylib
30 // BUILD: $CC foo29.c -dynamiclib -install_name $RUN_DIR/libfoo29.dylib -o $BUILD_DIR/libfoo29.dylib
31 // BUILD: $CC foo30.c -dynamiclib -install_name $RUN_DIR/libfoo30.dylib -o $BUILD_DIR/libfoo30.dylib
32 // BUILD: $CC foo31.c -dynamiclib -install_name $RUN_DIR/libfoo31.dylib -o $BUILD_DIR/libfoo31.dylib
33 // BUILD: $CC foo32.c -dynamiclib -install_name $RUN_DIR/libfoo32.dylib -o $BUILD_DIR/libfoo32.dylib
34
35 // BUILD: $CC main.c -o $BUILD_DIR/launch-image-cache.exe $BUILD_DIR/libfoo1.dylib $BUILD_DIR/libfoo2.dylib $BUILD_DIR/libfoo3.dylib $BUILD_DIR/libfoo4.dylib $BUILD_DIR/libfoo5.dylib $BUILD_DIR/libfoo6.dylib $BUILD_DIR/libfoo7.dylib $BUILD_DIR/libfoo8.dylib $BUILD_DIR/libfoo9.dylib $BUILD_DIR/libfoo10.dylib $BUILD_DIR/libfoo11.dylib $BUILD_DIR/libfoo12.dylib $BUILD_DIR/libfoo13.dylib $BUILD_DIR/libfoo14.dylib $BUILD_DIR/libfoo15.dylib $BUILD_DIR/libfoo16.dylib $BUILD_DIR/libfoo17.dylib $BUILD_DIR/libfoo18.dylib $BUILD_DIR/libfoo19.dylib $BUILD_DIR/libfoo20.dylib $BUILD_DIR/libfoo21.dylib $BUILD_DIR/libfoo22.dylib $BUILD_DIR/libfoo23.dylib $BUILD_DIR/libfoo24.dylib $BUILD_DIR/libfoo25.dylib $BUILD_DIR/libfoo26.dylib $BUILD_DIR/libfoo27.dylib $BUILD_DIR/libfoo28.dylib $BUILD_DIR/libfoo29.dylib $BUILD_DIR/libfoo30.dylib $BUILD_DIR/libfoo31.dylib $BUILD_DIR/libfoo32.dylib
36
37 // RUN: ./launch-image-cache.exe
38
39 // Generate these with:
40 // for i in `seq 1 32`; do ( echo "int foo$i() { return $i; };" > foo$i.c ); done
41 // for i in `seq 1 32`; do ( echo "extern int foo$i();" ); done
42 // for i in `seq 1 32`; do ( echo "if (failedCheck(foo$i(), $i)) return 0;" ); done
43 // for i in `seq 1 32`; do ( echo "\$CC foo$i.c -dynamiclib -install_name \$RUN_DIR/libfoo$i.dylib -o \$BUILD_DIR/libfoo$i.dylib" ); done
44 // for i in `seq 1 32`; do ( echo -n "\$BUILD_DIR/libfoo$i.dylib " ); done
45
46 #include <stdio.h>
47
48 #include "test_support.h"
49
50 extern int foo1();
51 extern int foo2();
52 extern int foo3();
53 extern int foo4();
54 extern int foo5();
55 extern int foo6();
56 extern int foo7();
57 extern int foo8();
58 extern int foo9();
59 extern int foo10();
60 extern int foo11();
61 extern int foo12();
62 extern int foo13();
63 extern int foo14();
64 extern int foo15();
65 extern int foo16();
66 extern int foo17();
67 extern int foo18();
68 extern int foo19();
69 extern int foo20();
70 extern int foo21();
71 extern int foo22();
72 extern int foo23();
73 extern int foo24();
74 extern int foo25();
75 extern int foo26();
76 extern int foo27();
77 extern int foo28();
78 extern int foo29();
79 extern int foo30();
80 extern int foo31();
81 extern int foo32();
82
83 void failedCheck(int i, int j) {
84 if (i != j) {
85 FAIL("expected %d but got %d", j, i);
86 }
87 }
88
89 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
90 failedCheck(foo1(), 1);
91 failedCheck(foo2(), 2);
92 failedCheck(foo3(), 3);
93 failedCheck(foo4(), 4);
94 failedCheck(foo5(), 5);
95 failedCheck(foo6(), 6);
96 failedCheck(foo7(), 7);
97 failedCheck(foo8(), 8);
98 failedCheck(foo9(), 9);
99 failedCheck(foo10(), 10);
100 failedCheck(foo11(), 11);
101 failedCheck(foo12(), 12);
102 failedCheck(foo13(), 13);
103 failedCheck(foo14(), 14);
104 failedCheck(foo15(), 15);
105 failedCheck(foo16(), 16);
106 failedCheck(foo17(), 17);
107 failedCheck(foo18(), 18);
108 failedCheck(foo19(), 19);
109 failedCheck(foo20(), 20);
110 failedCheck(foo21(), 21);
111 failedCheck(foo22(), 22);
112 failedCheck(foo23(), 23);
113 failedCheck(foo24(), 24);
114 failedCheck(foo25(), 25);
115 failedCheck(foo26(), 26);
116 failedCheck(foo27(), 27);
117 failedCheck(foo28(), 28);
118 failedCheck(foo29(), 29);
119 failedCheck(foo30(), 30);
120 failedCheck(foo31(), 31);
121 failedCheck(foo32(), 32);
122
123 PASS("Success");
124 }
125