]> git.proxmox.com Git - rustc.git/blobdiff - vendor/backtrace/tests/accuracy/main.rs
New upstream version 1.46.0~beta.2+dfsg1
[rustc.git] / vendor / backtrace / tests / accuracy / main.rs
index 7c484a24e507e99b92a4f435563e633acac46386..b339d3161a021be8b377f062fb404e45d36fe00a 100644 (file)
@@ -16,6 +16,31 @@ type Pos = (&'static str, u32);
 
 #[test]
 fn doit() {
+    if
+    // Skip musl which is by default statically linked and doesn't support
+    // dynamic libraries.
+    !cfg!(target_env = "musl")
+    // Skip MinGW on libbacktrace which doesn't have support for DLLs.
+    && !(cfg!(windows) && cfg!(target_env = "gnu") && cfg!(feature = "libbacktrace"))
+    {
+        // TODO(#238) this shouldn't have to happen first in this function, but
+        // currently it does.
+        let mut dir = std::env::current_exe().unwrap();
+        dir.pop();
+        if cfg!(windows) {
+            dir.push("dylib_dep.dll");
+        } else if cfg!(target_os = "macos") {
+            dir.push("libdylib_dep.dylib");
+        } else {
+            dir.push("libdylib_dep.so");
+        }
+        let lib = libloading::Library::new(&dir).unwrap();
+        let api = unsafe { lib.get::<extern "C" fn(Pos, fn(Pos, Pos))>(b"foo").unwrap() };
+        api(pos!(), |a, b| {
+            check!(a, b);
+        });
+    }
+
     outer(pos!());
 }
 
@@ -39,14 +64,12 @@ fn inner(main_pos: Pos, outer_pos: Pos) {
 }
 
 #[inline(always)]
-#[cfg_attr(feature = "coresymbolication", inline(never))]
 #[rustfmt::skip]
 fn inner_inlined(main_pos: Pos, outer_pos: Pos) {
     check!(main_pos, outer_pos);
     check!(main_pos, outer_pos);
 
     #[inline(always)]
-    #[cfg_attr(feature = "coresymbolication", inline(never))]
     fn inner_further_inlined(main_pos: Pos, outer_pos: Pos, inner_pos: Pos) {
         check!(main_pos, outer_pos, inner_pos);
     }