We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
dlsym!
1 parent 0804417 commit dd28c1eCopy full SHA for dd28c1e
library/std/src/sys/pal/unix/weak/tests.rs
@@ -2,15 +2,26 @@ use super::*;
2
use crate::ffi::c_int;
3
4
#[test]
5
-fn dlsym() {
+fn dlsym_existing() {
6
// Try to find a symbol that definitely exists.
7
dlsym! {
8
fn abs(i: c_int) -> c_int;
9
}
10
11
+ dlsym! {
12
+ #[link_name = "abs"]
13
+ fn custom_name(i: c_int) -> c_int;
14
+ }
15
+
16
let abs = abs.get().unwrap();
17
assert_eq!(unsafe { abs(-1) }, 1);
18
19
+ let custom_name = custom_name.get().unwrap();
20
+ assert_eq!(unsafe { custom_name(-1) }, 1);
21
+}
22
23
+#[test]
24
+fn dlsym_missing() {
25
// Try to find a symbol that definitely does not exist.
26
27
fn test_symbol_that_does_not_exist() -> c_int;
0 commit comments