Add a cdylib-only crate test

This commit is contained in:
hyd-dev 2021-02-14 23:33:24 +08:00
parent 51c6f51c36
commit 1923044705
No known key found for this signature in database
GPG Key ID: 74FA7FD5B8DA14B8
4 changed files with 27 additions and 0 deletions

View File

@ -11,6 +11,7 @@ name = "cargo-miri-test"
version = "0.1.0"
dependencies = [
"byteorder",
"cdylib",
"issue_1567",
"issue_1691",
"issue_1705",
@ -18,6 +19,13 @@ dependencies = [
"serde_derive",
]
[[package]]
name = "cdylib"
version = "0.1.0"
dependencies = [
"byteorder",
]
[[package]]
name = "cfg-if"
version = "0.1.10"

View File

@ -9,6 +9,7 @@ edition = "2018"
[dependencies]
byteorder = "1.0"
cdylib = { path = "cdylib" }
issue_1567 = { path = "issue-1567" }
issue_1691 = { path = "issue-1691" }
issue_1705 = { path = "issue-1705" }

View File

@ -0,0 +1,12 @@
[package]
name = "cdylib"
version = "0.1.0"
authors = ["Miri Team"]
edition = "2018"
[lib]
# cargo-miri used to handle `cdylib` crate-type specially (https://github.com/rust-lang/miri/pull/1577).
crate-type = ["cdylib"]
[dependencies]
byteorder = "1.0"

View File

@ -0,0 +1,6 @@
use byteorder::{BigEndian, ByteOrder};
#[no_mangle]
extern "C" fn use_the_dependency() {
let _n = <BigEndian as ByteOrder>::read_u64(&[1,2,3,4,5,6,7,8]);
}