about summary refs log tree commit diff
path: root/tests/codegen/issues
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2023-03-16 18:44:35 -0700
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-03-20 10:25:29 +0000
commit48011e2aa483069681fed062faa60773d0fae53b (patch)
tree57acea06417f7e6d6c4022d7e1151c16a4e80493 /tests/codegen/issues
parent5dfe37a5044376834825e55dcc3a4bb4b52bb237 (diff)
downloadrust-48011e2aa483069681fed062faa60773d0fae53b.tar.gz
rust-48011e2aa483069681fed062faa60773d0fae53b.zip
Also move the auxiliary file
Diffstat (limited to 'tests/codegen/issues')
-rw-r--r--tests/codegen/issues/auxiliary/static_dllimport_aux.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/codegen/issues/auxiliary/static_dllimport_aux.rs b/tests/codegen/issues/auxiliary/static_dllimport_aux.rs
new file mode 100644
index 00000000000..afb0dc42f44
--- /dev/null
+++ b/tests/codegen/issues/auxiliary/static_dllimport_aux.rs
@@ -0,0 +1,13 @@
+use std::sync::atomic::{AtomicPtr, Ordering};
+
+#[inline(always)]
+pub fn memrchr() {
+    fn detect() {}
+
+    static CROSS_CRATE_STATIC_ITEM: AtomicPtr<()> = AtomicPtr::new(detect as *mut ());
+
+    unsafe {
+        let fun = CROSS_CRATE_STATIC_ITEM.load(Ordering::SeqCst);
+        std::mem::transmute::<*mut (), fn()>(fun)()
+    }
+}