Reorganize and improve semantic tests for dllexport/import