]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/thread-local-cleanup.dtest/main.c
2 // BUILD: $CC foo.c -dynamiclib -install_name $RUN_DIR/libtlv.dylib -o $BUILD_DIR/libtlv.dylib
3 // BUILD: $CC main.c -DRUN_DIR="$RUN_DIR" -o $BUILD_DIR/thread-local-cleanup.exe
5 // RUN: ./thread-local-cleanup.exe
10 #include "test_support.h"
12 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
13 for (int i
=0; i
< 1000; ++i
) {
14 void* handle
= dlopen(RUN_DIR
"/libtlv.dylib", RTLD_FIRST
);
15 if ( handle
== NULL
) {
16 FAIL("dlopen error: iteration %d %s", i
, dlerror());
19 int result
= dlclose(handle
);
21 FAIL("dlclose error: iteration %d %s", i
, dlerror());