def test_apple_lto_export_dynamic(self):
        '''
        Tests that -Wl,-export_dynamic is correctly added, when export_dynamic: true is set.
        On macOS, this is relevant for LTO builds only.
        '''
        testdir = os.path.join(self.common_test_dir, '148 shared module resolving symbol in executable')
        # Ensure that it builds even with LTO enabled
        env = {'CFLAGS': '-flto'}
        self.init(testdir, override_envvars=env)
        self.build()
        self.run_tests()

        Tests that -Wl,-export_dynamic is correctly added, when export_dynamic: true is set.
        On macOS, this is relevant for LTO builds only.
        
unittests/darwintests.py