Remove testing_only_libclang_3_8 and expectations

This commit is contained in:
Darren Kulp 2020-06-23 15:48:31 -07:00 committed by Emilio Cobos Álvarez
parent 4ea1e21bcc
commit 03dbd1a3f8
18 changed files with 1 additions and 550 deletions

View File

@ -87,4 +87,3 @@ testing_only_libclang_9 = []
testing_only_libclang_5 = []
testing_only_libclang_4 = []
testing_only_libclang_3_9 = []
testing_only_libclang_3_8 = []

View File

@ -15,4 +15,3 @@ testing_only_libclang_9 = ["bindgen/testing_only_libclang_9"]
testing_only_libclang_5 = ["bindgen/testing_only_libclang_5"]
testing_only_libclang_4 = ["bindgen/testing_only_libclang_4"]
testing_only_libclang_3_9 = ["bindgen/testing_only_libclang_3_9"]
testing_only_libclang_3_8 = ["bindgen/testing_only_libclang_3_8"]

View File

@ -27,8 +27,6 @@ fn clang_version_check() {
Some((4, 0))
} else if cfg!(feature = "testing_only_libclang_3_9") {
Some((3, 9))
} else if cfg!(feature = "testing_only_libclang_3_8") {
Some((3, 8))
} else {
None
};

View File

@ -9,7 +9,6 @@ use std::io::Write;
use std::path::Path;
const LIBCLANG_VERSION_DIRS: &'static [&'static str] = &[
"libclang-3.8",
"libclang-3.9",
"libclang-4",
"libclang-5",

View File

@ -1,15 +0,0 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
extern "C" {
#[link_name = "\u{1}_Z1acz"]
pub fn a(arg1: ::std::os::raw::c_char, ...) -> ::std::os::raw::c_char;
}
extern "C" {
#[link_name = "\u{1}_Z1bcz"]
pub fn b(arg1: ::std::os::raw::c_char, ...) -> ::std::os::raw::c_char;
}

View File

@ -1,38 +0,0 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Foo {
pub _address: u8,
}
extern "C" {
#[link_name = "\u{1}_ZN3Foo4kFooE"]
pub static Foo_kFoo: bool;
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(
::std::mem::size_of::<Foo>(),
1usize,
concat!("Size of: ", stringify!(Foo))
);
assert_eq!(
::std::mem::align_of::<Foo>(),
1usize,
concat!("Alignment of ", stringify!(Foo))
);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Bar {
pub _address: u8,
}
extern "C" {
#[link_name = "\u{1}_Z5Test2v"]
pub fn Test2() -> ::std::os::raw::c_uint;
}

View File

@ -1,61 +0,0 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#![cfg(not(test))]
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct JNINativeInterface_ {
pub GetVersion: ::std::option::Option<
unsafe extern "stdcall" fn(
env: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>,
pub __hack: ::std::os::raw::c_ulonglong,
}
#[test]
fn bindgen_test_layout_JNINativeInterface_() {
assert_eq!(
::std::mem::size_of::<JNINativeInterface_>(),
16usize,
concat!("Size of: ", stringify!(JNINativeInterface_))
);
assert_eq!(
::std::mem::align_of::<JNINativeInterface_>(),
8usize,
concat!("Alignment of ", stringify!(JNINativeInterface_))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JNINativeInterface_>())).GetVersion
as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(JNINativeInterface_),
"::",
stringify!(GetVersion)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JNINativeInterface_>())).__hack as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(JNINativeInterface_),
"::",
stringify!(__hack)
)
);
}
extern "C" {
#[link_name = "\u{1}_bar@0"]
pub fn bar();
}

View File

@ -1,38 +0,0 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
extern "C" {
#[link_name = "\u{1}_ZL1k"]
pub static k: bool;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct A {
pub _address: u8,
}
extern "C" {
#[link_name = "\u{1}_ZN1A1kE"]
pub static A_k: bool;
}
#[test]
fn bindgen_test_layout_A() {
assert_eq!(
::std::mem::size_of::<A>(),
1usize,
concat!("Size of: ", stringify!(A))
);
assert_eq!(
::std::mem::align_of::<A>(),
1usize,
concat!("Alignment of ", stringify!(A))
);
}
pub type foo = bool;
extern "C" {
#[link_name = "\u{1}_ZL2k2"]
pub static k2: foo;
}

View File

@ -1,41 +0,0 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo;
pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum _bindgen_ty_1 {
foo = 4,
bar = 8,
}
pub type EasyToOverflow = ::std::os::raw::c_ulonglong;
pub const k: EasyToOverflow = 2147483648;
extern "C" {
pub static k_expr: EasyToOverflow;
}
extern "C" {
pub static wow: EasyToOverflow;
}
extern "C" {
pub static BAZ: ::std::os::raw::c_longlong;
}
extern "C" {
pub static fuzz: f64;
}
extern "C" {
pub static BAZZ: ::std::os::raw::c_char;
}
extern "C" {
pub static WAT: ::std::os::raw::c_char;
}
extern "C" {
pub static mut bytestring: *const ::std::os::raw::c_char;
}
extern "C" {
pub static mut NOT_UTF8: *const ::std::os::raw::c_char;
}

View File

@ -1,9 +0,0 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#![allow(overflowing_literals)]
pub const a: u32 = 18446744073709551611;

View File

@ -1,61 +0,0 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub mod root {
#[allow(unused_imports)]
use self::super::root;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Rooted<T> {
pub member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for Rooted<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[test]
fn __bindgen_test_layout_Rooted_open0_int_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>(),
4usize,
concat!(
"Size of template specialization: ",
stringify!(root::Rooted<::std::os::raw::c_int>)
)
);
assert_eq!(
::std::mem::align_of::<root::Rooted<::std::os::raw::c_int>>(),
4usize,
concat!(
"Alignment of template specialization: ",
stringify!(root::Rooted<::std::os::raw::c_int>)
)
);
}
#[test]
fn __bindgen_test_layout_Rooted_open0_int_close0_instantiation_1() {
assert_eq!(
::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>(),
4usize,
concat!(
"Size of template specialization: ",
stringify!(root::Rooted<::std::os::raw::c_int>)
)
);
assert_eq!(
::std::mem::align_of::<root::Rooted<::std::os::raw::c_int>>(),
4usize,
concat!(
"Alignment of template specialization: ",
stringify!(root::Rooted<::std::os::raw::c_int>)
)
);
}
}

View File

@ -1,56 +0,0 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
extern "C" {
pub fn foo();
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Foo {
pub _address: u8,
}
extern "C" {
#[link_name = "\u{1}?sBar@Foo@@2_NA"]
pub static mut Foo_sBar: bool;
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(
::std::mem::size_of::<Foo>(),
1usize,
concat!("Size of: ", stringify!(Foo))
);
assert_eq!(
::std::mem::align_of::<Foo>(),
1usize,
concat!("Alignment of ", stringify!(Foo))
);
}
extern "C" {
#[link_name = "\u{1}@fast_call_func_no_args@0"]
pub fn fast_call_func_no_args() -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "\u{1}@fast_call_func_many_args@12"]
pub fn fast_call_func_many_args(
arg1: ::std::os::raw::c_int,
arg2: ::std::os::raw::c_int,
arg3: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "\u{1}_std_call_func_no_args@0"]
pub fn std_call_func_no_args() -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "\u{1}_std_call_func_many_args@12"]
pub fn std_call_func_many_args(
arg1: ::std::os::raw::c_int,
arg2: ::std::os::raw::c_int,
arg3: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}

View File

@ -1,66 +0,0 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#![cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
#[allow(non_camel_case_types)]
pub type id = *mut objc::runtime::Object;
#[repr(transparent)]
#[derive(Clone, Copy)]
pub struct Foo(pub id);
impl std::ops::Deref for Foo {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for Foo {}
impl Foo {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(objc::class!(Foo), alloc) })
}
}
impl IFoo for Foo {}
pub trait IFoo: Sized + std::ops::Deref {}
#[repr(transparent)]
#[derive(Clone, Copy)]
pub struct Bar(pub id);
impl std::ops::Deref for Bar {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for Bar {}
impl Bar {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(objc::class!(Bar), alloc) })
}
}
impl IFoo for Bar {}
impl IBar for Bar {}
pub trait IBar: Sized + std::ops::Deref {}
#[repr(transparent)]
#[derive(Clone, Copy)]
pub struct Baz(pub id);
impl std::ops::Deref for Baz {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for Baz {}
impl Baz {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(objc::class!(Baz), alloc) })
}
}
impl IBar for Baz {}
impl IFoo for Baz {}
impl IBaz for Baz {}
pub trait IBaz: Sized + std::ops::Deref {}

View File

@ -1,65 +0,0 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#![cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
#[allow(non_camel_case_types)]
pub type id = *mut objc::runtime::Object;
#[repr(transparent)]
#[derive(Clone, Copy)]
pub struct Foo(pub id);
impl std::ops::Deref for Foo {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for Foo {}
impl Foo {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(objc::class!(Foo), alloc) })
}
}
impl<ObjectType: 'static> IFoo<ObjectType> for Foo {}
pub trait IFoo<ObjectType>: Sized + std::ops::Deref {
unsafe fn get(self) -> id
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(self, get)
}
}
#[repr(transparent)]
#[derive(Clone, Copy)]
pub struct FooMultiGeneric(pub id);
impl std::ops::Deref for FooMultiGeneric {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for FooMultiGeneric {}
impl FooMultiGeneric {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(objc::class!(FooMultiGeneric), alloc) })
}
}
impl<KeyType: 'static, ObjectType: 'static>
IFooMultiGeneric<KeyType, ObjectType> for FooMultiGeneric
{
}
pub trait IFooMultiGeneric<KeyType, ObjectType>:
Sized + std::ops::Deref
{
unsafe fn objectForKey_(self, key: id) -> id
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(self, objectForKey: key)
}
}

View File

@ -1,51 +0,0 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Base {
pub _address: u8,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Derived {
pub b: bool,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Usage {
pub _address: u8,
}
extern "C" {
#[link_name = "\u{1}_ZN5Usage13static_memberE"]
pub static mut Usage_static_member: [u32; 2usize];
}
#[test]
fn bindgen_test_layout_Usage() {
assert_eq!(
::std::mem::size_of::<Usage>(),
1usize,
concat!("Size of: ", stringify!(Usage))
);
assert_eq!(
::std::mem::align_of::<Usage>(),
1usize,
concat!("Alignment of ", stringify!(Usage))
);
}
extern "C" {
#[link_name = "\u{1}_ZN5UsageC1Ev"]
pub fn Usage_Usage(this: *mut Usage);
}
impl Usage {
#[inline]
pub unsafe fn new() -> Self {
let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
Usage_Usage(__bindgen_tmp.as_mut_ptr());
__bindgen_tmp.assume_init()
}
}

View File

@ -1,37 +0,0 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Rooted {
pub ptr: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_Rooted() {
assert_eq!(
::std::mem::size_of::<Rooted>(),
4usize,
concat!("Size of: ", stringify!(Rooted))
);
assert_eq!(
::std::mem::align_of::<Rooted>(),
4usize,
concat!("Alignment of ", stringify!(Rooted))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<Rooted>())).ptr as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(Rooted),
"::",
stringify!(ptr)
)
);
}
/// <div rustbindgen replaces="MaybeWrapped"></div>
pub type MaybeWrapped<a> = a;

View File

@ -14,11 +14,7 @@ extern crate bindgen;
/// how long bindings generation takes for Stylo. Stylo bindings generation
/// takes too long to be a proper `#[bench]`.
#[test]
#[cfg(not(any(
debug_assertions,
feature = "testing_only_extra_assertions",
feature = "testing_only_libclang_3_8"
)))]
#[cfg(not(any(debug_assertions, feature = "testing_only_extra_assertions",)))]
#[cfg(any(
feature = "testing_only_libclang_3_9",
feature = "testing_only_libclang_4",

View File

@ -144,8 +144,6 @@ fn compare_generated_header(
expectation.push("libclang-4");
} else if cfg!(feature = "testing_only_libclang_3_9") {
expectation.push("libclang-3.9");
} else if cfg!(feature = "testing_only_libclang_3_8") {
expectation.push("libclang-3.8");
} else {
match clang_version().parsed {
None => {}