dart-sdk/tests/ffi_2
Simon Binder be893fdf27 [vm/ffi] Add providesSymbol to DynamicLibrary
This adds the providesSymbol method to DynamicLibrary. It returns
whether the library contains a function with the given name.

As per dlsym(3), it is valid for dlsym to return nullptr in a success
case if the symbol actually has a NULL value. So I've changed the logic
to check for dlerror() after we invoke dlsym(), both in the existing
lookup and in the new method.

Closes https://github.com/dart-lang/sdk/issues/46192

TEST=tests/ffi(_2)/has_symbol_test.dart

Change-Id: Ibcb1c051cc0cdd95a104fe86ef2fc76da5bafb5d
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-mac-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201900
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-06-02 16:01:43 +00:00
..
generator [VM/FFI] Adds FFI leaf calls. 2021-05-21 11:12:02 +00:00
aliasing_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
all_positive.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
allocator_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
analysis_options.yaml
callback_tests_utils.dart [VM/FFI] Adds FFI leaf calls. 2021-05-21 11:12:02 +00:00
calloc_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
coordinate.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
data_not_asan_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
data_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
dylib_isolates_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
dylib_utils.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
expando_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
extension_methods_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
external_typed_data_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
ffi_2.status [test] Skip vmspecific_leaf_call_test in app_jitk 2021-05-25 13:47:10 +00:00
ffi_test_helpers.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
function_callbacks_many_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
function_callbacks_structs_by_value_generated_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
function_callbacks_structs_by_value_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
function_callbacks_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
function_callbacks_very_many_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
function_structs_by_value_generated_test.dart [VM/FFI] Adds FFI leaf calls. 2021-05-21 11:12:02 +00:00
function_structs_test.dart [VM/FFI] Adds FFI leaf calls. 2021-05-21 11:12:02 +00:00
function_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
function_very_many_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
hardfp_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
has_symbol_test.dart [vm/ffi] Add providesSymbol to DynamicLibrary 2021-06-02 16:01:43 +00:00
inline_array_multi_dimensional_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
inline_array_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
native_effect_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
negative_function_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
null_regress_39068_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
null_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
prepare_flutter_bundle.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_37254_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_39044_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_39063_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_39885_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_40537_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_43016_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_43693_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_44985_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_44986_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_45189_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_45198_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_45507_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_45988_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
regress_46004_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
regress_46085_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
regress_46127_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
regress_flutter79441_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_jump_to_frame_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
sizeof_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
snapshot_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
stacktrace_regress_37910_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
structs_nested_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
structs_packed_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
structs_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
unaligned_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
variance_function_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
very_large_struct.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_dynamic_library_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_enable_ffi_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_function_callbacks_exit_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_function_callbacks_negative_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_function_callbacks_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
vmspecific_function_gc_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
vmspecific_function_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_handle_dynamically_linked_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_handle_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
vmspecific_highmem_32bit_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_leaf_call_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
vmspecific_null_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_object_gc_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_regress_37100_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_regress_37511_callbacks_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
vmspecific_regress_37511_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
vmspecific_regress_37780_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_regress_38993_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_send_port_id_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_static_checks_test.dart [VM/FFI] Adds FFI leaf calls. 2021-05-21 11:12:02 +00:00
vmspecific_variance_function_checks_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00