]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/launch-image-cache.dtest/main.c
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
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
37 // RUN: ./launch-image-cache.exe
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
81 int failedCheck(int i
, int j
) {
83 printf("[FAIL] launch-image-cache: expected %d but got %d\n", j
, i
);
91 printf("[BEGIN] launch-image-cache\n");
93 if (failedCheck(foo1(), 1)) return 0;
94 if (failedCheck(foo2(), 2)) return 0;
95 if (failedCheck(foo3(), 3)) return 0;
96 if (failedCheck(foo4(), 4)) return 0;
97 if (failedCheck(foo5(), 5)) return 0;
98 if (failedCheck(foo6(), 6)) return 0;
99 if (failedCheck(foo7(), 7)) return 0;
100 if (failedCheck(foo8(), 8)) return 0;
101 if (failedCheck(foo9(), 9)) return 0;
102 if (failedCheck(foo10(), 10)) return 0;
103 if (failedCheck(foo11(), 11)) return 0;
104 if (failedCheck(foo12(), 12)) return 0;
105 if (failedCheck(foo13(), 13)) return 0;
106 if (failedCheck(foo14(), 14)) return 0;
107 if (failedCheck(foo15(), 15)) return 0;
108 if (failedCheck(foo16(), 16)) return 0;
109 if (failedCheck(foo17(), 17)) return 0;
110 if (failedCheck(foo18(), 18)) return 0;
111 if (failedCheck(foo19(), 19)) return 0;
112 if (failedCheck(foo20(), 20)) return 0;
113 if (failedCheck(foo21(), 21)) return 0;
114 if (failedCheck(foo22(), 22)) return 0;
115 if (failedCheck(foo23(), 23)) return 0;
116 if (failedCheck(foo24(), 24)) return 0;
117 if (failedCheck(foo25(), 25)) return 0;
118 if (failedCheck(foo26(), 26)) return 0;
119 if (failedCheck(foo27(), 27)) return 0;
120 if (failedCheck(foo28(), 28)) return 0;
121 if (failedCheck(foo29(), 29)) return 0;
122 if (failedCheck(foo30(), 30)) return 0;
123 if (failedCheck(foo31(), 31)) return 0;
124 if (failedCheck(foo32(), 32)) return 0;
126 printf("[PASS] launch-image-cache\n");