diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml index 20543d69bcb0f..8d85ad794ed53 100644 --- a/libc-test/Cargo.toml +++ b/libc-test/Cargo.toml @@ -85,3 +85,8 @@ harness = true name = "semver" path = "test/semver.rs" harness = false + +[[test]] +name = "primitive_types" +path = "test/primitive_types.rs" +harness = true diff --git a/libc-test/test/primitive_types.rs b/libc-test/test/primitive_types.rs new file mode 100644 index 0000000000000..c125a92a58110 --- /dev/null +++ b/libc-test/test/primitive_types.rs @@ -0,0 +1,15 @@ +use std::any::TypeId; + +macro_rules! ok { + ($($t:ident)*) => {$( + assert!(TypeId::of::() == TypeId::of::(), + "{} is wrong", stringify!($t)); + )*} +} + +#[test] +fn same() { + use std::ffi; + ok!(c_char c_schar c_uchar c_short c_ushort c_int c_uint c_long c_ulong + c_longlong c_ulonglong c_float c_double); +}