(self, args)
| 2944 | 'pthreads': (['-pthread', '-sEXIT_RUNTIME', '-sPROXY_TO_PTHREAD', '-Wno-experimental'],), |
| 2945 | }) |
| 2946 | def test_dlfcn_basic(self, args): |
| 2947 | if args: |
| 2948 | self.require_pthreads() |
| 2949 | self.cflags += args |
| 2950 | create_file('libside.cpp', ''' |
| 2951 | #include <cstdio> |
| 2952 | |
| 2953 | class Foo { |
| 2954 | public: |
| 2955 | Foo() { |
| 2956 | puts("Constructing lib object."); |
| 2957 | } |
| 2958 | }; |
| 2959 | |
| 2960 | Foo side_global; |
| 2961 | ''') |
| 2962 | self.build_dlfcn_lib('libside.cpp') |
| 2963 | |
| 2964 | self.prep_dlfcn_main() |
| 2965 | src = ''' |
| 2966 | #include <cstdio> |
| 2967 | #include <dlfcn.h> |
| 2968 | |
| 2969 | class Bar { |
| 2970 | public: |
| 2971 | Bar() { |
| 2972 | puts("Constructing main object."); |
| 2973 | } |
| 2974 | }; |
| 2975 | |
| 2976 | Bar global; |
| 2977 | |
| 2978 | int main() { |
| 2979 | dlopen("libside.so", RTLD_NOW); |
| 2980 | return 0; |
| 2981 | } |
| 2982 | ''' |
| 2983 | self.do_run(src, 'Constructing main object.\nConstructing lib object.\n') |
| 2984 | |
| 2985 | @needs_dylink |
| 2986 | def test_dlfcn_i64(self): |
nothing calls this directly
no test coverage detected