Repository: rust-lang/rust-bindgen
Pull request #2719 (2024-01-13 00:40:53)

ci: Remove llvm 5, introduce llvm 16
LLVM 5 is ancient.

emilio: r? @pvdrz (if you have the cycles)

Most of it is moving expectations around. I had to unfortunately remove the macOS llvm16 tests because the runner is on x86-64 but llvm provides only releases for arm macOS nowadays.
emilio: Okay I got macOS CI, but on 9.0 due to ^. Better than nothing tho.

Patch:
diff --git a/.github/workflows/bindgen.yml b/.github/workflows/bindgen.yml
index 3f85cd86..ebf70dce 100644
--- a/.github/workflows/bindgen.yml
+++ b/.github/workflows/bindgen.yml
@@ -142,7 +142,7 @@ jobs:
           - debian: null
             cross: null
             rust: null
-        llvm_version: ["5.0", "9.0"]
+        llvm_version: ["9.0", "16.0"]
         main_tests: [1]
         release_build: [0, 1]
         no_default_features: [0, 1]
@@ -155,7 +155,7 @@ jobs:
           # Test with extra asserts + docs just with latest llvm versions to
           # prevent explosion
           - os: ubuntu-latest
-            llvm_version: "9.0"
+            llvm_version: "16.0"
             release_build: 0
             no_default_features: 0
             feature_extra_asserts: 1
@@ -169,12 +169,15 @@ jobs:
           #     debian: arm64
           #     cross: aarch64-linux-gnu
           #     rust: aarch64-unknown-linux-gnu
-          #   llvm_version: "9.0"
+          #   llvm_version: "16.0"
           #   main_tests: 0
           #   release_build: 0
           #   feature_extra_asserts: 0
 
           # Ensure stuff works on macos too
+          # FIXME: Ideally should use the latest llvm version, but llvm doesn't
+          # provide releases for x86-64 macOS anymore which is what the runner uses.
+          #
           - os: macos-latest
             llvm_version: "9.0"
             release_build: 0
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7e5cdc53..62cf8074 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -208,8 +208,8 @@ can add multiple test expectations, one for each supported `libclang`
 version. Instead of having a single `bindgen-tests/tests/expectations/tests/my_test.rs` file,
 add each of:
 
+* `bindgen-tests/tests/expectations/tests/libclang-16/my_test.rs`
 * `bindgen-tests/tests/expectations/tests/libclang-9/my_test.rs`
-* `bindgen-tests/tests/expectations/tests/libclang-5/my_test.rs`
 
 If you need to update the test expectations for a test file that generates
 different bindings for different `libclang` versions, you *don't* need to have
@@ -226,12 +226,6 @@ to check the bindings against with a cargo feature:
 $ cargo test --features __testing_only_libclang_$VERSION
 ```
 
-Where `$VERSION` is one of:
-
-* `4`
-* `3_9`
-* `3_8`
-
 depending on which version of `libclang` you have installed.
 
 ### Integration Tests
diff --git a/appveyor.yml b/appveyor.yml
index 973b4cdf..ffb74eed 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -2,18 +2,18 @@ environment:
   RUST_BACKTRACE: 1
   RUST_CHANNEL: "%Configuration%"
   matrix:
-  - TARGET: gnu
-    LLVM_VERSION: 5.0.0-1
-    BINDGEN_FEATURES: __testing_only_libclang_5
   - TARGET: gnu
     LLVM_VERSION: 9.0.0-1
     BINDGEN_FEATURES: __testing_only_libclang_9
-  - TARGET: msvc
-    LLVM_VERSION: 5.0.0
-    BINDGEN_FEATURES: __testing_only_libclang_5
+  - TARGET: gnu
+    LLVM_VERSION: 16.0.4
+    BINDGEN_FEATURES: __testing_only_libclang_16
   - TARGET: msvc
     LLVM_VERSION: 9.0.0
     BINDGEN_FEATURES: __testing_only_libclang_9
+  - TARGET: msvc
+    LLVM_VERSION: 16.0.4
+    BINDGEN_FEATURES: __testing_only_libclang_16
 
 configuration:
 - stable
diff --git a/bindgen-cli/Cargo.toml b/bindgen-cli/Cargo.toml
index 27389528..5e04cb0d 100644
--- a/bindgen-cli/Cargo.toml
+++ b/bindgen-cli/Cargo.toml
@@ -40,7 +40,7 @@ which-rustfmt = ["bindgen/which-rustfmt"]
 # Features used for CI testing 
 __testing_only_extra_assertions = ["bindgen/__testing_only_extra_assertions"]
 __testing_only_libclang_9 = ["bindgen/__testing_only_libclang_9"]
-__testing_only_libclang_5 = ["bindgen/__testing_only_libclang_5"]
+__testing_only_libclang_16 = ["bindgen/__testing_only_libclang_16"]
 
 [package.metadata.release]
 release = true
diff --git a/bindgen-cli/main.rs b/bindgen-cli/main.rs
index a3407232..4b1bfad2 100644
--- a/bindgen-cli/main.rs
+++ b/bindgen-cli/main.rs
@@ -13,10 +13,10 @@ use crate::options::builder_from_flags;
 #[cfg(feature = "logging")]
 fn clang_version_check() {
     let version = bindgen::clang_version();
-    let expected_version = if cfg!(feature = "__testing_only_libclang_9") {
+    let expected_version = if cfg!(feature = "__testing_only_libclang_16") {
+        Some((16, 0))
+    } else if cfg!(feature = "__testing_only_libclang_9") {
         Some((9, 0))
-    } else if cfg!(feature = "__testing_only_libclang_5") {
-        Some((5, 0))
     } else {
         None
     };
diff --git a/bindgen-integration/Cargo.toml b/bindgen-integration/Cargo.toml
index 6c9508ab..ccdd1467 100644
--- a/bindgen-integration/Cargo.toml
+++ b/bindgen-integration/Cargo.toml
@@ -16,4 +16,4 @@ runtime = ["bindgen/runtime"]
 
 __testing_only_extra_assertions = ["bindgen/__testing_only_extra_assertions"]
 __testing_only_libclang_9 = ["bindgen/__testing_only_libclang_9"]
-__testing_only_libclang_5 = ["bindgen/__testing_only_libclang_5"]
+__testing_only_libclang_16 = ["bindgen/__testing_only_libclang_16"]
diff --git a/bindgen/Cargo.toml b/bindgen/Cargo.toml
index 7dd4d01d..733679a6 100644
--- a/bindgen/Cargo.toml
+++ b/bindgen/Cargo.toml
@@ -58,7 +58,7 @@ __cli = []
 # Features used for CI testing
 __testing_only_extra_assertions = []
 __testing_only_libclang_9 = []
-__testing_only_libclang_5 = []
+__testing_only_libclang_16 = []
 
 [package.metadata.docs.rs]
 features = ["experimental"]


Test patch:
diff --git a/bindgen-tests/Cargo.toml b/bindgen-tests/Cargo.toml
index d3907c36..1c06c3f1 100644
--- a/bindgen-tests/Cargo.toml
+++ b/bindgen-tests/Cargo.toml
@@ -23,4 +23,4 @@ which-rustfmt = ["bindgen/which-rustfmt"]
 
 __testing_only_extra_assertions = ["bindgen/__testing_only_extra_assertions"]
 __testing_only_libclang_9 = ["bindgen/__testing_only_libclang_9"]
-__testing_only_libclang_5 = ["bindgen/__testing_only_libclang_5"]
+__testing_only_libclang_16 = ["bindgen/__testing_only_libclang_16"]
diff --git a/bindgen-tests/tests/expectations/build.rs b/bindgen-tests/tests/expectations/build.rs
index 21111853..6136823e 100644
--- a/bindgen-tests/tests/expectations/build.rs
+++ b/bindgen-tests/tests/expectations/build.rs
@@ -8,7 +8,7 @@ use std::fs;
 use std::io::Write;
 use std::path::Path;
 
-const LIBCLANG_VERSION_DIRS: &[&str] = &["libclang-5", "libclang-9"];
+const LIBCLANG_VERSION_DIRS: &[&str] = &["libclang-9"];
 
 fn main() {
     println!("cargo:rerun-if-changed=build.rs");
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/abi_variadic_function.rs b/bindgen-tests/tests/expectations/tests/abi_variadic_function.rs
similarity index 100%
rename from bindgen-tests/tests/expectations/tests/libclang-5/abi_variadic_function.rs
rename to bindgen-tests/tests/expectations/tests/abi_variadic_function.rs
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/auto.rs b/bindgen-tests/tests/expectations/tests/auto.rs
similarity index 100%
rename from bindgen-tests/tests/expectations/tests/libclang-5/auto.rs
rename to bindgen-tests/tests/expectations/tests/auto.rs
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/call-conv-field.rs b/bindgen-tests/tests/expectations/tests/call-conv-field.rs
similarity index 100%
rename from bindgen-tests/tests/expectations/tests/libclang-5/call-conv-field.rs
rename to bindgen-tests/tests/expectations/tests/call-conv-field.rs
diff --git a/bindgen-tests/tests/expectations/tests/class.rs b/bindgen-tests/tests/expectations/tests/class.rs
index ce43204d..19668a73 100644
--- a/bindgen-tests/tests/expectations/tests/class.rs
+++ b/bindgen-tests/tests/expectations/tests/class.rs
@@ -178,6 +178,8 @@ pub struct C_with_incomplete_array {
 }
 #[test]
 fn bindgen_test_layout_C_with_incomplete_array() {
+    const UNINIT: ::std::mem::MaybeUninit<C_with_incomplete_array> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<C_with_incomplete_array>(),
         40usize,
@@ -188,6 +190,36 @@ fn bindgen_test_layout_C_with_incomplete_array() {
         4usize,
         concat!("Alignment of ", stringify!(C_with_incomplete_array)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_incomplete_array),
+            "::",
+            stringify!(a),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_incomplete_array),
+            "::",
+            stringify!(big_array),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
+        37usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_incomplete_array),
+            "::",
+            stringify!(incomplete_array),
+        ),
+    );
 }
 impl Default for C_with_incomplete_array {
     fn default() -> Self {
@@ -206,6 +238,8 @@ pub struct C_with_incomplete_array_2 {
 }
 #[test]
 fn bindgen_test_layout_C_with_incomplete_array_2() {
+    const UNINIT: ::std::mem::MaybeUninit<C_with_incomplete_array_2> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<C_with_incomplete_array_2>(),
         4usize,
@@ -216,6 +250,26 @@ fn bindgen_test_layout_C_with_incomplete_array_2() {
         4usize,
         concat!("Alignment of ", stringify!(C_with_incomplete_array_2)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_incomplete_array_2),
+            "::",
+            stringify!(a),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_incomplete_array_2),
+            "::",
+            stringify!(incomplete_array),
+        ),
+    );
 }
 #[repr(C)]
 pub struct C_with_zero_length_array_and_incomplete_array {
@@ -226,6 +280,10 @@ pub struct C_with_zero_length_array_and_incomplete_array {
 }
 #[test]
 fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array() {
+    const UNINIT: ::std::mem::MaybeUninit<
+        C_with_zero_length_array_and_incomplete_array,
+    > = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array>(),
         40usize,
@@ -239,6 +297,48 @@ fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array() {
             stringify!(C_with_zero_length_array_and_incomplete_array),
         ),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array),
+            "::",
+            stringify!(a),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array),
+            "::",
+            stringify!(big_array),
+        ),
+    );
+    assert_eq!(
+        unsafe {
+            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
+        },
+        37usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array),
+            "::",
+            stringify!(zero_length_array),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
+        37usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array),
+            "::",
+            stringify!(incomplete_array),
+        ),
+    );
 }
 impl Default for C_with_zero_length_array_and_incomplete_array {
     fn default() -> Self {
@@ -258,6 +358,10 @@ pub struct C_with_zero_length_array_and_incomplete_array_2 {
 }
 #[test]
 fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array_2() {
+    const UNINIT: ::std::mem::MaybeUninit<
+        C_with_zero_length_array_and_incomplete_array_2,
+    > = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array_2>(),
         4usize,
@@ -271,6 +375,38 @@ fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array_2() {
             stringify!(C_with_zero_length_array_and_incomplete_array_2),
         ),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array_2),
+            "::",
+            stringify!(a),
+        ),
+    );
+    assert_eq!(
+        unsafe {
+            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
+        },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array_2),
+            "::",
+            stringify!(zero_length_array),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array_2),
+            "::",
+            stringify!(incomplete_array),
+        ),
+    );
 }
 #[repr(C)]
 #[derive(Debug, Default, Hash, PartialOrd, Ord, PartialEq, Eq)]
@@ -304,6 +440,8 @@ pub struct IncompleteArrayNonCopiable {
 }
 #[test]
 fn bindgen_test_layout_IncompleteArrayNonCopiable() {
+    const UNINIT: ::std::mem::MaybeUninit<IncompleteArrayNonCopiable> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<IncompleteArrayNonCopiable>(),
         8usize,
@@ -314,6 +452,26 @@ fn bindgen_test_layout_IncompleteArrayNonCopiable() {
         8usize,
         concat!("Alignment of ", stringify!(IncompleteArrayNonCopiable)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).whatever) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(IncompleteArrayNonCopiable),
+            "::",
+            stringify!(whatever),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
+        8usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(IncompleteArrayNonCopiable),
+            "::",
+            stringify!(incomplete_array),
+        ),
+    );
 }
 impl Default for IncompleteArrayNonCopiable {
     fn default() -> Self {
diff --git a/bindgen-tests/tests/expectations/tests/class_1_0.rs b/bindgen-tests/tests/expectations/tests/class_1_0.rs
index 17cf1182..b6544212 100644
--- a/bindgen-tests/tests/expectations/tests/class_1_0.rs
+++ b/bindgen-tests/tests/expectations/tests/class_1_0.rs
@@ -231,6 +231,8 @@ pub struct C_with_incomplete_array {
 }
 #[test]
 fn bindgen_test_layout_C_with_incomplete_array() {
+    const UNINIT: ::std::mem::MaybeUninit<C_with_incomplete_array> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<C_with_incomplete_array>(),
         40usize,
@@ -241,6 +243,36 @@ fn bindgen_test_layout_C_with_incomplete_array() {
         4usize,
         concat!("Alignment of ", stringify!(C_with_incomplete_array)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_incomplete_array),
+            "::",
+            stringify!(a),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_incomplete_array),
+            "::",
+            stringify!(big_array),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
+        37usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_incomplete_array),
+            "::",
+            stringify!(incomplete_array),
+        ),
+    );
 }
 impl Default for C_with_incomplete_array {
     fn default() -> Self {
@@ -259,6 +291,8 @@ pub struct C_with_incomplete_array_2 {
 }
 #[test]
 fn bindgen_test_layout_C_with_incomplete_array_2() {
+    const UNINIT: ::std::mem::MaybeUninit<C_with_incomplete_array_2> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<C_with_incomplete_array_2>(),
         4usize,
@@ -269,6 +303,26 @@ fn bindgen_test_layout_C_with_incomplete_array_2() {
         4usize,
         concat!("Alignment of ", stringify!(C_with_incomplete_array_2)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_incomplete_array_2),
+            "::",
+            stringify!(a),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_incomplete_array_2),
+            "::",
+            stringify!(incomplete_array),
+        ),
+    );
 }
 #[repr(C)]
 pub struct C_with_zero_length_array_and_incomplete_array {
@@ -279,6 +333,10 @@ pub struct C_with_zero_length_array_and_incomplete_array {
 }
 #[test]
 fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array() {
+    const UNINIT: ::std::mem::MaybeUninit<
+        C_with_zero_length_array_and_incomplete_array,
+    > = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array>(),
         40usize,
@@ -292,6 +350,48 @@ fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array() {
             stringify!(C_with_zero_length_array_and_incomplete_array),
         ),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array),
+            "::",
+            stringify!(a),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array),
+            "::",
+            stringify!(big_array),
+        ),
+    );
+    assert_eq!(
+        unsafe {
+            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
+        },
+        37usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array),
+            "::",
+            stringify!(zero_length_array),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
+        37usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array),
+            "::",
+            stringify!(incomplete_array),
+        ),
+    );
 }
 impl Default for C_with_zero_length_array_and_incomplete_array {
     fn default() -> Self {
@@ -311,6 +411,10 @@ pub struct C_with_zero_length_array_and_incomplete_array_2 {
 }
 #[test]
 fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array_2() {
+    const UNINIT: ::std::mem::MaybeUninit<
+        C_with_zero_length_array_and_incomplete_array_2,
+    > = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array_2>(),
         4usize,
@@ -324,6 +428,38 @@ fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array_2() {
             stringify!(C_with_zero_length_array_and_incomplete_array_2),
         ),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array_2),
+            "::",
+            stringify!(a),
+        ),
+    );
+    assert_eq!(
+        unsafe {
+            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
+        },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array_2),
+            "::",
+            stringify!(zero_length_array),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(C_with_zero_length_array_and_incomplete_array_2),
+            "::",
+            stringify!(incomplete_array),
+        ),
+    );
 }
 #[repr(C)]
 #[derive(Debug, Default, Hash, PartialEq, Eq)]
@@ -357,6 +493,8 @@ pub struct IncompleteArrayNonCopiable {
 }
 #[test]
 fn bindgen_test_layout_IncompleteArrayNonCopiable() {
+    const UNINIT: ::std::mem::MaybeUninit<IncompleteArrayNonCopiable> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<IncompleteArrayNonCopiable>(),
         8usize,
@@ -367,6 +505,26 @@ fn bindgen_test_layout_IncompleteArrayNonCopiable() {
         8usize,
         concat!("Alignment of ", stringify!(IncompleteArrayNonCopiable)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).whatever) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(IncompleteArrayNonCopiable),
+            "::",
+            stringify!(whatever),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
+        8usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(IncompleteArrayNonCopiable),
+            "::",
+            stringify!(incomplete_array),
+        ),
+    );
 }
 impl Default for IncompleteArrayNonCopiable {
     fn default() -> Self {
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/const_bool.rs b/bindgen-tests/tests/expectations/tests/const_bool.rs
similarity index 100%
rename from bindgen-tests/tests/expectations/tests/libclang-5/const_bool.rs
rename to bindgen-tests/tests/expectations/tests/const_bool.rs
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/constant-evaluate.rs b/bindgen-tests/tests/expectations/tests/constant-evaluate.rs
similarity index 100%
rename from bindgen-tests/tests/expectations/tests/libclang-5/constant-evaluate.rs
rename to bindgen-tests/tests/expectations/tests/constant-evaluate.rs
diff --git a/bindgen-tests/tests/expectations/tests/constified-enum-module-overflow.rs b/bindgen-tests/tests/expectations/tests/constified-enum-module-overflow.rs
index 49498dea..61e666d2 100644
--- a/bindgen-tests/tests/expectations/tests/constified-enum-module-overflow.rs
+++ b/bindgen-tests/tests/expectations/tests/constified-enum-module-overflow.rs
@@ -13,7 +13,7 @@ pub type C_U = B;
 #[repr(C)]
 #[derive(Debug, Default, Copy, Clone)]
 pub struct A {
-    pub u: u8,
+    pub u: B,
 }
 #[test]
 fn bindgen_test_layout_A() {
@@ -44,3 +44,16 @@ fn __bindgen_test_layout_C_open0_A_close0_instantiation() {
         concat!("Alignment of template specialization: ", stringify!(C)),
     );
 }
+#[test]
+fn __bindgen_test_layout_B_open0_A_close0_instantiation() {
+    assert_eq!(
+        ::std::mem::size_of::<B>(),
+        1usize,
+        concat!("Size of template specialization: ", stringify!(B)),
+    );
+    assert_eq!(
+        ::std::mem::align_of::<B>(),
+        1usize,
+        concat!("Alignment of template specialization: ", stringify!(B)),
+    );
+}
diff --git a/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs b/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs
index 2a1090e1..d1b4c900 100644
--- a/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs
+++ b/bindgen-tests/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs
@@ -75,6 +75,8 @@ pub struct test2 {
 }
 #[test]
 fn bindgen_test_layout_test2() {
+    const UNINIT: ::std::mem::MaybeUninit<test2> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<test2>(),
         4usize,
@@ -85,6 +87,21 @@ fn bindgen_test_layout_test2() {
         4usize,
         concat!("Alignment of ", stringify!(test2)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
+        0usize,
+        concat!("Offset of field: ", stringify!(test2), "::", stringify!(a)),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(test2),
+            "::",
+            stringify!(incomplete_array),
+        ),
+    );
 }
 #[repr(C)]
 #[derive(Debug, Default)]
@@ -95,6 +112,8 @@ pub struct test3 {
 }
 #[test]
 fn bindgen_test_layout_test3() {
+    const UNINIT: ::std::mem::MaybeUninit<test3> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<test3>(),
         4usize,
@@ -105,4 +124,31 @@ fn bindgen_test_layout_test3() {
         4usize,
         concat!("Alignment of ", stringify!(test3)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
+        0usize,
+        concat!("Offset of field: ", stringify!(test3), "::", stringify!(a)),
+    );
+    assert_eq!(
+        unsafe {
+            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
+        },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(test3),
+            "::",
+            stringify!(zero_length_array),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(test3),
+            "::",
+            stringify!(incomplete_array),
+        ),
+    );
 }
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/error-E0600-cannot-apply-unary-negation-to-u32.rs b/bindgen-tests/tests/expectations/tests/error-E0600-cannot-apply-unary-negation-to-u32.rs
similarity index 100%
rename from bindgen-tests/tests/expectations/tests/libclang-5/error-E0600-cannot-apply-unary-negation-to-u32.rs
rename to bindgen-tests/tests/expectations/tests/error-E0600-cannot-apply-unary-negation-to-u32.rs
diff --git a/bindgen-tests/tests/expectations/tests/incomplete-array-padding.rs b/bindgen-tests/tests/expectations/tests/incomplete-array-padding.rs
index 4a14802d..c8038e1f 100644
--- a/bindgen-tests/tests/expectations/tests/incomplete-array-padding.rs
+++ b/bindgen-tests/tests/expectations/tests/incomplete-array-padding.rs
@@ -122,6 +122,8 @@ pub struct foo {
 }
 #[test]
 fn bindgen_test_layout_foo() {
+    const UNINIT: ::std::mem::MaybeUninit<foo> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<foo>(),
         8usize,
@@ -132,6 +134,11 @@ fn bindgen_test_layout_foo() {
         8usize,
         concat!("Alignment of ", stringify!(foo)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize },
+        8usize,
+        concat!("Offset of field: ", stringify!(foo), "::", stringify!(b)),
+    );
 }
 impl Default for foo {
     fn default() -> Self {
diff --git a/bindgen-tests/tests/expectations/tests/issue-544-stylo-creduce-2.rs b/bindgen-tests/tests/expectations/tests/issue-544-stylo-creduce-2.rs
index 835f029c..c81b6729 100644
--- a/bindgen-tests/tests/expectations/tests/issue-544-stylo-creduce-2.rs
+++ b/bindgen-tests/tests/expectations/tests/issue-544-stylo-creduce-2.rs
@@ -1,10 +1,11 @@
 #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
 #[repr(C)]
+#[derive(Debug, Copy, Clone)]
 pub struct Foo {
-    pub member: Foo_SecondAlias,
+    pub member: *mut Foo_SecondAlias,
 }
 pub type Foo_FirstAlias = [u8; 0usize];
-pub type Foo_SecondAlias = [u8; 0usize];
+pub type Foo_SecondAlias = Foo;
 impl Default for Foo {
     fn default() -> Self {
         let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
diff --git a/bindgen-tests/tests/expectations/tests/issue-643-inner-struct.rs b/bindgen-tests/tests/expectations/tests/issue-643-inner-struct.rs
index 673221e3..520b3b0e 100644
--- a/bindgen-tests/tests/expectations/tests/issue-643-inner-struct.rs
+++ b/bindgen-tests/tests/expectations/tests/issue-643-inner-struct.rs
@@ -99,6 +99,8 @@ fn bindgen_test_layout_rte_ring_cons() {
 }
 #[test]
 fn bindgen_test_layout_rte_ring() {
+    const UNINIT: ::std::mem::MaybeUninit<rte_ring> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<rte_ring>(),
         16usize,
@@ -109,6 +111,26 @@ fn bindgen_test_layout_rte_ring() {
         8usize,
         concat!("Alignment of ", stringify!(rte_ring)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).memzone) as usize - ptr as usize },
+        0usize,
+        concat!("Offset of field: ", stringify!(rte_ring), "::", stringify!(memzone)),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).prod) as usize - ptr as usize },
+        8usize,
+        concat!("Offset of field: ", stringify!(rte_ring), "::", stringify!(prod)),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).cons) as usize - ptr as usize },
+        12usize,
+        concat!("Offset of field: ", stringify!(rte_ring), "::", stringify!(cons)),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).ring) as usize - ptr as usize },
+        16usize,
+        concat!("Offset of field: ", stringify!(rte_ring), "::", stringify!(ring)),
+    );
 }
 impl Default for rte_ring {
     fn default() -> Self {
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/issue-769-bad-instantiation-test.rs b/bindgen-tests/tests/expectations/tests/issue-769-bad-instantiation-test.rs
similarity index 100%
rename from bindgen-tests/tests/expectations/tests/libclang-5/issue-769-bad-instantiation-test.rs
rename to bindgen-tests/tests/expectations/tests/issue-769-bad-instantiation-test.rs
diff --git a/bindgen-tests/tests/expectations/tests/layout_align.rs b/bindgen-tests/tests/expectations/tests/layout_align.rs
index 81fc8359..be77dc75 100644
--- a/bindgen-tests/tests/expectations/tests/layout_align.rs
+++ b/bindgen-tests/tests/expectations/tests/layout_align.rs
@@ -129,6 +129,8 @@ pub struct rte_kni_fifo {
 }
 #[test]
 fn bindgen_test_layout_rte_kni_fifo() {
+    const UNINIT: ::std::mem::MaybeUninit<rte_kni_fifo> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<rte_kni_fifo>(),
         16usize,
@@ -139,6 +141,36 @@ fn bindgen_test_layout_rte_kni_fifo() {
         8usize,
         concat!("Alignment of ", stringify!(rte_kni_fifo)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).write) as usize - ptr as usize },
+        0usize,
+        concat!("Offset of field: ", stringify!(rte_kni_fifo), "::", stringify!(write)),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize },
+        4usize,
+        concat!("Offset of field: ", stringify!(rte_kni_fifo), "::", stringify!(read)),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
+        8usize,
+        concat!("Offset of field: ", stringify!(rte_kni_fifo), "::", stringify!(len)),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).elem_size) as usize - ptr as usize },
+        12usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(rte_kni_fifo),
+            "::",
+            stringify!(elem_size),
+        ),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize },
+        16usize,
+        concat!("Offset of field: ", stringify!(rte_kni_fifo), "::", stringify!(buffer)),
+    );
 }
 impl Default for rte_kni_fifo {
     fn default() -> Self {
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/inline_namespace_nested.rs b/bindgen-tests/tests/expectations/tests/libclang-5/inline_namespace_nested.rs
deleted file mode 100644
index 996b877e..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-5/inline_namespace_nested.rs
+++ /dev/null
@@ -1,1 +0,0 @@
-/* error generating bindings */
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/issue-2556.rs b/bindgen-tests/tests/expectations/tests/libclang-5/issue-2556.rs
deleted file mode 100644
index 996b877e..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-5/issue-2556.rs
+++ /dev/null
@@ -1,1 +0,0 @@
-/* error generating bindings */
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/objc_template.rs b/bindgen-tests/tests/expectations/tests/libclang-5/objc_template.rs
deleted file mode 100644
index 7ab3ac45..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-5/objc_template.rs
+++ /dev/null
@@ -1,57 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#![cfg(target_os = "macos")]
-use objc::{self, msg_send, sel, sel_impl, class};
-#[allow(non_camel_case_types)]
-pub type id = *mut objc::runtime::Object;
-#[repr(transparent)]
-#[derive(Debug, Copy, Clone)]
-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!(class!(Foo), alloc) })
-    }
-}
-impl<ObjectType: 'static> IFoo<ObjectType> for Foo {}
-pub trait IFoo<ObjectType: 'static>: Sized + std::ops::Deref {
-    unsafe fn get(&self) -> *mut ObjectType
-    where
-        <Self as std::ops::Deref>::Target: objc::Message + Sized,
-    {
-        msg_send!(* self, get)
-    }
-}
-#[repr(transparent)]
-#[derive(Debug, Copy, Clone)]
-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!(class!(FooMultiGeneric), alloc) })
-    }
-}
-impl<KeyType: 'static, ObjectType: 'static> IFooMultiGeneric<KeyType, ObjectType>
-for FooMultiGeneric {}
-pub trait IFooMultiGeneric<
-    KeyType: 'static,
-    ObjectType: 'static,
->: Sized + std::ops::Deref {
-    unsafe fn objectForKey_(&self, key: *mut KeyType) -> *mut ObjectType
-    where
-        <Self as std::ops::Deref>::Target: objc::Message + Sized,
-    {
-        msg_send!(* self, objectForKey : key)
-    }
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/ptr32-has-different-size.rs b/bindgen-tests/tests/expectations/tests/libclang-5/ptr32-has-different-size.rs
deleted file mode 100644
index 0d677052..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-5/ptr32-has-different-size.rs
+++ /dev/null
@@ -1,41 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct TEST_STRUCT {
-    pub ptr_32bit: *mut ::std::os::raw::c_void,
-}
-#[test]
-fn bindgen_test_layout_TEST_STRUCT() {
-    const UNINIT: ::std::mem::MaybeUninit<TEST_STRUCT> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<TEST_STRUCT>(),
-        8usize,
-        concat!("Size of: ", stringify!(TEST_STRUCT)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<TEST_STRUCT>(),
-        8usize,
-        concat!("Alignment of ", stringify!(TEST_STRUCT)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).ptr_32bit) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(TEST_STRUCT),
-            "::",
-            stringify!(ptr_32bit),
-        ),
-    );
-}
-impl Default for TEST_STRUCT {
-    fn default() -> Self {
-        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-        unsafe {
-            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-            s.assume_init()
-        }
-    }
-}
-pub type TEST = TEST_STRUCT;
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/abi_variadic_function.rs b/bindgen-tests/tests/expectations/tests/libclang-9/abi_variadic_function.rs
deleted file mode 100644
index 3cb7248c..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/abi_variadic_function.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-extern "C" {
-    #[link_name = "\u{1}_Z1bcz"]
-    pub fn b(arg1: ::std::os::raw::c_char, ...) -> ::std::os::raw::c_char;
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/auto.rs b/bindgen-tests/tests/expectations/tests/libclang-9/auto.rs
deleted file mode 100644
index 340bc670..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/auto.rs
+++ /dev/null
@@ -1,29 +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,
-}
-pub const Foo_kFoo: bool = true;
-#[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;
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/call-conv-field.rs b/bindgen-tests/tests/expectations/tests/libclang-9/call-conv-field.rs
deleted file mode 100644
index e3179543..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/call-conv-field.rs
+++ /dev/null
@@ -1,50 +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_() {
-    const UNINIT: ::std::mem::MaybeUninit<JNINativeInterface_> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    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::addr_of!((*ptr).GetVersion) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(JNINativeInterface_),
-            "::",
-            stringify!(GetVersion),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).__hack) as usize - ptr as usize },
-        8usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(JNINativeInterface_),
-            "::",
-            stringify!(__hack),
-        ),
-    );
-}
-extern "stdcall" {
-    pub fn bar();
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/class.rs b/bindgen-tests/tests/expectations/tests/libclang-9/class.rs
deleted file mode 100644
index 19668a73..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/class.rs
+++ /dev/null
@@ -1,617 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#[repr(C)]
-#[derive(Default)]
-pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
-impl<T> __IncompleteArrayField<T> {
-    #[inline]
-    pub const fn new() -> Self {
-        __IncompleteArrayField(::std::marker::PhantomData, [])
-    }
-    #[inline]
-    pub fn as_ptr(&self) -> *const T {
-        self as *const _ as *const T
-    }
-    #[inline]
-    pub fn as_mut_ptr(&mut self) -> *mut T {
-        self as *mut _ as *mut T
-    }
-    #[inline]
-    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
-        ::std::slice::from_raw_parts(self.as_ptr(), len)
-    }
-    #[inline]
-    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
-        ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
-    }
-}
-impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
-    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        fmt.write_str("__IncompleteArrayField")
-    }
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct C {
-    pub a: ::std::os::raw::c_int,
-    pub big_array: [::std::os::raw::c_char; 33usize],
-}
-#[test]
-fn bindgen_test_layout_C() {
-    const UNINIT: ::std::mem::MaybeUninit<C> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<C>(), 40usize, concat!("Size of: ", stringify!(C)));
-    assert_eq!(
-        ::std::mem::align_of::<C>(),
-        4usize,
-        concat!("Alignment of ", stringify!(C)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(C), "::", stringify!(a)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
-        4usize,
-        concat!("Offset of field: ", stringify!(C), "::", stringify!(big_array)),
-    );
-}
-impl Default for C {
-    fn default() -> Self {
-        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-        unsafe {
-            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-            s.assume_init()
-        }
-    }
-}
-#[repr(C)]
-pub struct C_with_zero_length_array {
-    pub a: ::std::os::raw::c_int,
-    pub big_array: [::std::os::raw::c_char; 33usize],
-    pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_C_with_zero_length_array() {
-    const UNINIT: ::std::mem::MaybeUninit<C_with_zero_length_array> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_zero_length_array>(),
-        40usize,
-        concat!("Size of: ", stringify!(C_with_zero_length_array)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_zero_length_array>(),
-        4usize,
-        concat!("Alignment of ", stringify!(C_with_zero_length_array)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array),
-            "::",
-            stringify!(a),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array),
-            "::",
-            stringify!(big_array),
-        ),
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        37usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array),
-            "::",
-            stringify!(zero_length_array),
-        ),
-    );
-}
-impl Default for C_with_zero_length_array {
-    fn default() -> Self {
-        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-        unsafe {
-            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-            s.assume_init()
-        }
-    }
-}
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct C_with_zero_length_array_2 {
-    pub a: ::std::os::raw::c_int,
-    pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_C_with_zero_length_array_2() {
-    const UNINIT: ::std::mem::MaybeUninit<C_with_zero_length_array_2> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_zero_length_array_2>(),
-        4usize,
-        concat!("Size of: ", stringify!(C_with_zero_length_array_2)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_zero_length_array_2>(),
-        4usize,
-        concat!("Alignment of ", stringify!(C_with_zero_length_array_2)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_2),
-            "::",
-            stringify!(a),
-        ),
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_2),
-            "::",
-            stringify!(zero_length_array),
-        ),
-    );
-}
-#[repr(C)]
-pub struct C_with_incomplete_array {
-    pub a: ::std::os::raw::c_int,
-    pub big_array: [::std::os::raw::c_char; 33usize],
-    pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_C_with_incomplete_array() {
-    const UNINIT: ::std::mem::MaybeUninit<C_with_incomplete_array> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_incomplete_array>(),
-        40usize,
-        concat!("Size of: ", stringify!(C_with_incomplete_array)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_incomplete_array>(),
-        4usize,
-        concat!("Alignment of ", stringify!(C_with_incomplete_array)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_incomplete_array),
-            "::",
-            stringify!(a),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_incomplete_array),
-            "::",
-            stringify!(big_array),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        37usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_incomplete_array),
-            "::",
-            stringify!(incomplete_array),
-        ),
-    );
-}
-impl Default for C_with_incomplete_array {
-    fn default() -> Self {
-        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-        unsafe {
-            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-            s.assume_init()
-        }
-    }
-}
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct C_with_incomplete_array_2 {
-    pub a: ::std::os::raw::c_int,
-    pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_C_with_incomplete_array_2() {
-    const UNINIT: ::std::mem::MaybeUninit<C_with_incomplete_array_2> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_incomplete_array_2>(),
-        4usize,
-        concat!("Size of: ", stringify!(C_with_incomplete_array_2)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_incomplete_array_2>(),
-        4usize,
-        concat!("Alignment of ", stringify!(C_with_incomplete_array_2)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_incomplete_array_2),
-            "::",
-            stringify!(a),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_incomplete_array_2),
-            "::",
-            stringify!(incomplete_array),
-        ),
-    );
-}
-#[repr(C)]
-pub struct C_with_zero_length_array_and_incomplete_array {
-    pub a: ::std::os::raw::c_int,
-    pub big_array: [::std::os::raw::c_char; 33usize],
-    pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
-    pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array() {
-    const UNINIT: ::std::mem::MaybeUninit<
-        C_with_zero_length_array_and_incomplete_array,
-    > = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array>(),
-        40usize,
-        concat!("Size of: ", stringify!(C_with_zero_length_array_and_incomplete_array)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array>(),
-        4usize,
-        concat!(
-            "Alignment of ",
-            stringify!(C_with_zero_length_array_and_incomplete_array),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array),
-            "::",
-            stringify!(a),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array),
-            "::",
-            stringify!(big_array),
-        ),
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        37usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array),
-            "::",
-            stringify!(zero_length_array),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        37usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array),
-            "::",
-            stringify!(incomplete_array),
-        ),
-    );
-}
-impl Default for C_with_zero_length_array_and_incomplete_array {
-    fn default() -> Self {
-        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-        unsafe {
-            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-            s.assume_init()
-        }
-    }
-}
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct C_with_zero_length_array_and_incomplete_array_2 {
-    pub a: ::std::os::raw::c_int,
-    pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
-    pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array_2() {
-    const UNINIT: ::std::mem::MaybeUninit<
-        C_with_zero_length_array_and_incomplete_array_2,
-    > = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array_2>(),
-        4usize,
-        concat!("Size of: ", stringify!(C_with_zero_length_array_and_incomplete_array_2)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array_2>(),
-        4usize,
-        concat!(
-            "Alignment of ",
-            stringify!(C_with_zero_length_array_and_incomplete_array_2),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array_2),
-            "::",
-            stringify!(a),
-        ),
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array_2),
-            "::",
-            stringify!(zero_length_array),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array_2),
-            "::",
-            stringify!(incomplete_array),
-        ),
-    );
-}
-#[repr(C)]
-#[derive(Debug, Default, Hash, PartialOrd, Ord, PartialEq, Eq)]
-pub struct WithDtor {
-    pub b: ::std::os::raw::c_int,
-}
-#[test]
-fn bindgen_test_layout_WithDtor() {
-    const UNINIT: ::std::mem::MaybeUninit<WithDtor> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<WithDtor>(),
-        4usize,
-        concat!("Size of: ", stringify!(WithDtor)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<WithDtor>(),
-        4usize,
-        concat!("Alignment of ", stringify!(WithDtor)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(WithDtor), "::", stringify!(b)),
-    );
-}
-#[repr(C)]
-pub struct IncompleteArrayNonCopiable {
-    pub whatever: *mut ::std::os::raw::c_void,
-    pub incomplete_array: __IncompleteArrayField<C>,
-}
-#[test]
-fn bindgen_test_layout_IncompleteArrayNonCopiable() {
-    const UNINIT: ::std::mem::MaybeUninit<IncompleteArrayNonCopiable> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<IncompleteArrayNonCopiable>(),
-        8usize,
-        concat!("Size of: ", stringify!(IncompleteArrayNonCopiable)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<IncompleteArrayNonCopiable>(),
-        8usize,
-        concat!("Alignment of ", stringify!(IncompleteArrayNonCopiable)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).whatever) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(IncompleteArrayNonCopiable),
-            "::",
-            stringify!(whatever),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        8usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(IncompleteArrayNonCopiable),
-            "::",
-            stringify!(incomplete_array),
-        ),
-    );
-}
-impl Default for IncompleteArrayNonCopiable {
-    fn default() -> Self {
-        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-        unsafe {
-            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-            s.assume_init()
-        }
-    }
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub union Union {
-    pub d: f32,
-    pub i: ::std::os::raw::c_int,
-}
-#[test]
-fn bindgen_test_layout_Union() {
-    const UNINIT: ::std::mem::MaybeUninit<Union> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<Union>(),
-        4usize,
-        concat!("Size of: ", stringify!(Union)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<Union>(),
-        4usize,
-        concat!("Alignment of ", stringify!(Union)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(Union), "::", stringify!(d)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).i) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(Union), "::", stringify!(i)),
-    );
-}
-impl Default for Union {
-    fn default() -> Self {
-        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-        unsafe {
-            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-            s.assume_init()
-        }
-    }
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct WithUnion {
-    pub data: Union,
-}
-#[test]
-fn bindgen_test_layout_WithUnion() {
-    const UNINIT: ::std::mem::MaybeUninit<WithUnion> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<WithUnion>(),
-        4usize,
-        concat!("Size of: ", stringify!(WithUnion)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<WithUnion>(),
-        4usize,
-        concat!("Alignment of ", stringify!(WithUnion)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(WithUnion), "::", stringify!(data)),
-    );
-}
-impl Default for WithUnion {
-    fn default() -> Self {
-        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-        unsafe {
-            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-            s.assume_init()
-        }
-    }
-}
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
-pub struct RealAbstractionWithTonsOfMethods {
-    pub _address: u8,
-}
-#[test]
-fn bindgen_test_layout_RealAbstractionWithTonsOfMethods() {
-    assert_eq!(
-        ::std::mem::size_of::<RealAbstractionWithTonsOfMethods>(),
-        1usize,
-        concat!("Size of: ", stringify!(RealAbstractionWithTonsOfMethods)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<RealAbstractionWithTonsOfMethods>(),
-        1usize,
-        concat!("Alignment of ", stringify!(RealAbstractionWithTonsOfMethods)),
-    );
-}
-extern "C" {
-    #[link_name = "\u{1}_ZNK32RealAbstractionWithTonsOfMethods3barEv"]
-    pub fn RealAbstractionWithTonsOfMethods_bar(
-        this: *const RealAbstractionWithTonsOfMethods,
-    );
-}
-extern "C" {
-    #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEv"]
-    pub fn RealAbstractionWithTonsOfMethods_bar1(
-        this: *mut RealAbstractionWithTonsOfMethods,
-    );
-}
-extern "C" {
-    #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEi"]
-    pub fn RealAbstractionWithTonsOfMethods_bar2(
-        this: *mut RealAbstractionWithTonsOfMethods,
-        foo: ::std::os::raw::c_int,
-    );
-}
-extern "C" {
-    #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3staEv"]
-    pub fn RealAbstractionWithTonsOfMethods_sta();
-}
-impl RealAbstractionWithTonsOfMethods {
-    #[inline]
-    pub unsafe fn bar(&self) {
-        RealAbstractionWithTonsOfMethods_bar(self)
-    }
-    #[inline]
-    pub unsafe fn bar1(&mut self) {
-        RealAbstractionWithTonsOfMethods_bar1(self)
-    }
-    #[inline]
-    pub unsafe fn bar2(&mut self, foo: ::std::os::raw::c_int) {
-        RealAbstractionWithTonsOfMethods_bar2(self, foo)
-    }
-    #[inline]
-    pub unsafe fn sta() {
-        RealAbstractionWithTonsOfMethods_sta()
-    }
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/class_1_0.rs b/bindgen-tests/tests/expectations/tests/libclang-9/class_1_0.rs
deleted file mode 100644
index b6544212..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/class_1_0.rs
+++ /dev/null
@@ -1,668 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#[repr(C)]
-#[derive(Default)]
-pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
-impl<T> __IncompleteArrayField<T> {
-    #[inline]
-    pub fn new() -> Self {
-        __IncompleteArrayField(::std::marker::PhantomData, [])
-    }
-    #[inline]
-    pub fn as_ptr(&self) -> *const T {
-        self as *const _ as *const T
-    }
-    #[inline]
-    pub fn as_mut_ptr(&mut self) -> *mut T {
-        self as *mut _ as *mut T
-    }
-    #[inline]
-    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
-        ::std::slice::from_raw_parts(self.as_ptr(), len)
-    }
-    #[inline]
-    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
-        ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
-    }
-}
-impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
-    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        fmt.write_str("__IncompleteArrayField")
-    }
-}
-#[repr(C)]
-pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
-impl<T> __BindgenUnionField<T> {
-    #[inline]
-    pub fn new() -> Self {
-        __BindgenUnionField(::std::marker::PhantomData)
-    }
-    #[inline]
-    pub unsafe fn as_ref(&self) -> &T {
-        ::std::mem::transmute(self)
-    }
-    #[inline]
-    pub unsafe fn as_mut(&mut self) -> &mut T {
-        ::std::mem::transmute(self)
-    }
-}
-impl<T> ::std::default::Default for __BindgenUnionField<T> {
-    #[inline]
-    fn default() -> Self {
-        Self::new()
-    }
-}
-impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
-    #[inline]
-    fn clone(&self) -> Self {
-        *self
-    }
-}
-impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
-impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
-    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        fmt.write_str("__BindgenUnionField")
-    }
-}
-impl<T> ::std::hash::Hash for __BindgenUnionField<T> {
-    fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) {}
-}
-impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
-    fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
-        true
-    }
-}
-impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
-#[repr(C)]
-#[derive(Copy)]
-pub struct C {
-    pub a: ::std::os::raw::c_int,
-    pub big_array: [::std::os::raw::c_char; 33usize],
-}
-#[test]
-fn bindgen_test_layout_C() {
-    const UNINIT: ::std::mem::MaybeUninit<C> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(::std::mem::size_of::<C>(), 40usize, concat!("Size of: ", stringify!(C)));
-    assert_eq!(
-        ::std::mem::align_of::<C>(),
-        4usize,
-        concat!("Alignment of ", stringify!(C)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(C), "::", stringify!(a)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
-        4usize,
-        concat!("Offset of field: ", stringify!(C), "::", stringify!(big_array)),
-    );
-}
-impl Clone for C {
-    fn clone(&self) -> Self {
-        *self
-    }
-}
-impl Default for C {
-    fn default() -> Self {
-        unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
-        }
-    }
-}
-impl ::std::cmp::PartialEq for C {
-    fn eq(&self, other: &C) -> bool {
-        self.a == other.a && &self.big_array[..] == &other.big_array[..]
-    }
-}
-#[repr(C)]
-pub struct C_with_zero_length_array {
-    pub a: ::std::os::raw::c_int,
-    pub big_array: [::std::os::raw::c_char; 33usize],
-    pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_C_with_zero_length_array() {
-    const UNINIT: ::std::mem::MaybeUninit<C_with_zero_length_array> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_zero_length_array>(),
-        40usize,
-        concat!("Size of: ", stringify!(C_with_zero_length_array)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_zero_length_array>(),
-        4usize,
-        concat!("Alignment of ", stringify!(C_with_zero_length_array)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array),
-            "::",
-            stringify!(a),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array),
-            "::",
-            stringify!(big_array),
-        ),
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        37usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array),
-            "::",
-            stringify!(zero_length_array),
-        ),
-    );
-}
-impl Default for C_with_zero_length_array {
-    fn default() -> Self {
-        unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
-        }
-    }
-}
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct C_with_zero_length_array_2 {
-    pub a: ::std::os::raw::c_int,
-    pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_C_with_zero_length_array_2() {
-    const UNINIT: ::std::mem::MaybeUninit<C_with_zero_length_array_2> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_zero_length_array_2>(),
-        4usize,
-        concat!("Size of: ", stringify!(C_with_zero_length_array_2)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_zero_length_array_2>(),
-        4usize,
-        concat!("Alignment of ", stringify!(C_with_zero_length_array_2)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_2),
-            "::",
-            stringify!(a),
-        ),
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_2),
-            "::",
-            stringify!(zero_length_array),
-        ),
-    );
-}
-#[repr(C)]
-pub struct C_with_incomplete_array {
-    pub a: ::std::os::raw::c_int,
-    pub big_array: [::std::os::raw::c_char; 33usize],
-    pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_C_with_incomplete_array() {
-    const UNINIT: ::std::mem::MaybeUninit<C_with_incomplete_array> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_incomplete_array>(),
-        40usize,
-        concat!("Size of: ", stringify!(C_with_incomplete_array)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_incomplete_array>(),
-        4usize,
-        concat!("Alignment of ", stringify!(C_with_incomplete_array)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_incomplete_array),
-            "::",
-            stringify!(a),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_incomplete_array),
-            "::",
-            stringify!(big_array),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        37usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_incomplete_array),
-            "::",
-            stringify!(incomplete_array),
-        ),
-    );
-}
-impl Default for C_with_incomplete_array {
-    fn default() -> Self {
-        unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
-        }
-    }
-}
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct C_with_incomplete_array_2 {
-    pub a: ::std::os::raw::c_int,
-    pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_C_with_incomplete_array_2() {
-    const UNINIT: ::std::mem::MaybeUninit<C_with_incomplete_array_2> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_incomplete_array_2>(),
-        4usize,
-        concat!("Size of: ", stringify!(C_with_incomplete_array_2)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_incomplete_array_2>(),
-        4usize,
-        concat!("Alignment of ", stringify!(C_with_incomplete_array_2)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_incomplete_array_2),
-            "::",
-            stringify!(a),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_incomplete_array_2),
-            "::",
-            stringify!(incomplete_array),
-        ),
-    );
-}
-#[repr(C)]
-pub struct C_with_zero_length_array_and_incomplete_array {
-    pub a: ::std::os::raw::c_int,
-    pub big_array: [::std::os::raw::c_char; 33usize],
-    pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
-    pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array() {
-    const UNINIT: ::std::mem::MaybeUninit<
-        C_with_zero_length_array_and_incomplete_array,
-    > = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array>(),
-        40usize,
-        concat!("Size of: ", stringify!(C_with_zero_length_array_and_incomplete_array)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array>(),
-        4usize,
-        concat!(
-            "Alignment of ",
-            stringify!(C_with_zero_length_array_and_incomplete_array),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array),
-            "::",
-            stringify!(a),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).big_array) as usize - ptr as usize },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array),
-            "::",
-            stringify!(big_array),
-        ),
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        37usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array),
-            "::",
-            stringify!(zero_length_array),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        37usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array),
-            "::",
-            stringify!(incomplete_array),
-        ),
-    );
-}
-impl Default for C_with_zero_length_array_and_incomplete_array {
-    fn default() -> Self {
-        unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
-        }
-    }
-}
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct C_with_zero_length_array_and_incomplete_array_2 {
-    pub a: ::std::os::raw::c_int,
-    pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
-    pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array_2() {
-    const UNINIT: ::std::mem::MaybeUninit<
-        C_with_zero_length_array_and_incomplete_array_2,
-    > = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array_2>(),
-        4usize,
-        concat!("Size of: ", stringify!(C_with_zero_length_array_and_incomplete_array_2)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array_2>(),
-        4usize,
-        concat!(
-            "Alignment of ",
-            stringify!(C_with_zero_length_array_and_incomplete_array_2),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array_2),
-            "::",
-            stringify!(a),
-        ),
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array_2),
-            "::",
-            stringify!(zero_length_array),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(C_with_zero_length_array_and_incomplete_array_2),
-            "::",
-            stringify!(incomplete_array),
-        ),
-    );
-}
-#[repr(C)]
-#[derive(Debug, Default, Hash, PartialEq, Eq)]
-pub struct WithDtor {
-    pub b: ::std::os::raw::c_int,
-}
-#[test]
-fn bindgen_test_layout_WithDtor() {
-    const UNINIT: ::std::mem::MaybeUninit<WithDtor> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<WithDtor>(),
-        4usize,
-        concat!("Size of: ", stringify!(WithDtor)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<WithDtor>(),
-        4usize,
-        concat!("Alignment of ", stringify!(WithDtor)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(WithDtor), "::", stringify!(b)),
-    );
-}
-#[repr(C)]
-pub struct IncompleteArrayNonCopiable {
-    pub whatever: *mut ::std::os::raw::c_void,
-    pub incomplete_array: __IncompleteArrayField<C>,
-}
-#[test]
-fn bindgen_test_layout_IncompleteArrayNonCopiable() {
-    const UNINIT: ::std::mem::MaybeUninit<IncompleteArrayNonCopiable> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<IncompleteArrayNonCopiable>(),
-        8usize,
-        concat!("Size of: ", stringify!(IncompleteArrayNonCopiable)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<IncompleteArrayNonCopiable>(),
-        8usize,
-        concat!("Alignment of ", stringify!(IncompleteArrayNonCopiable)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).whatever) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(IncompleteArrayNonCopiable),
-            "::",
-            stringify!(whatever),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        8usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(IncompleteArrayNonCopiable),
-            "::",
-            stringify!(incomplete_array),
-        ),
-    );
-}
-impl Default for IncompleteArrayNonCopiable {
-    fn default() -> Self {
-        unsafe {
-            let mut s: Self = ::std::mem::uninitialized();
-            ::std::ptr::write_bytes(&mut s, 0, 1);
-            s
-        }
-    }
-}
-#[repr(C)]
-#[derive(Debug, Default, Copy, Hash, PartialEq)]
-pub struct Union {
-    pub d: __BindgenUnionField<f32>,
-    pub i: __BindgenUnionField<::std::os::raw::c_int>,
-    pub bindgen_union_field: u32,
-}
-#[test]
-fn bindgen_test_layout_Union() {
-    const UNINIT: ::std::mem::MaybeUninit<Union> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<Union>(),
-        4usize,
-        concat!("Size of: ", stringify!(Union)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<Union>(),
-        4usize,
-        concat!("Alignment of ", stringify!(Union)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(Union), "::", stringify!(d)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).i) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(Union), "::", stringify!(i)),
-    );
-}
-impl Clone for Union {
-    fn clone(&self) -> Self {
-        *self
-    }
-}
-#[repr(C)]
-#[derive(Debug, Default, Copy, Hash, PartialEq)]
-pub struct WithUnion {
-    pub data: Union,
-}
-#[test]
-fn bindgen_test_layout_WithUnion() {
-    const UNINIT: ::std::mem::MaybeUninit<WithUnion> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<WithUnion>(),
-        4usize,
-        concat!("Size of: ", stringify!(WithUnion)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<WithUnion>(),
-        4usize,
-        concat!("Alignment of ", stringify!(WithUnion)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(WithUnion), "::", stringify!(data)),
-    );
-}
-impl Clone for WithUnion {
-    fn clone(&self) -> Self {
-        *self
-    }
-}
-#[repr(C)]
-#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
-pub struct RealAbstractionWithTonsOfMethods {
-    pub _address: u8,
-}
-#[test]
-fn bindgen_test_layout_RealAbstractionWithTonsOfMethods() {
-    assert_eq!(
-        ::std::mem::size_of::<RealAbstractionWithTonsOfMethods>(),
-        1usize,
-        concat!("Size of: ", stringify!(RealAbstractionWithTonsOfMethods)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<RealAbstractionWithTonsOfMethods>(),
-        1usize,
-        concat!("Alignment of ", stringify!(RealAbstractionWithTonsOfMethods)),
-    );
-}
-extern "C" {
-    #[link_name = "\u{1}_ZNK32RealAbstractionWithTonsOfMethods3barEv"]
-    pub fn RealAbstractionWithTonsOfMethods_bar(
-        this: *const RealAbstractionWithTonsOfMethods,
-    );
-}
-extern "C" {
-    #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEv"]
-    pub fn RealAbstractionWithTonsOfMethods_bar1(
-        this: *mut RealAbstractionWithTonsOfMethods,
-    );
-}
-extern "C" {
-    #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEi"]
-    pub fn RealAbstractionWithTonsOfMethods_bar2(
-        this: *mut RealAbstractionWithTonsOfMethods,
-        foo: ::std::os::raw::c_int,
-    );
-}
-extern "C" {
-    #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3staEv"]
-    pub fn RealAbstractionWithTonsOfMethods_sta();
-}
-impl Clone for RealAbstractionWithTonsOfMethods {
-    fn clone(&self) -> Self {
-        *self
-    }
-}
-impl RealAbstractionWithTonsOfMethods {
-    #[inline]
-    pub unsafe fn bar(&self) {
-        RealAbstractionWithTonsOfMethods_bar(self)
-    }
-    #[inline]
-    pub unsafe fn bar1(&mut self) {
-        RealAbstractionWithTonsOfMethods_bar1(self)
-    }
-    #[inline]
-    pub unsafe fn bar2(&mut self, foo: ::std::os::raw::c_int) {
-        RealAbstractionWithTonsOfMethods_bar2(self, foo)
-    }
-    #[inline]
-    pub unsafe fn sta() {
-        RealAbstractionWithTonsOfMethods_sta()
-    }
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/const_bool.rs b/bindgen-tests/tests/expectations/tests/libclang-9/const_bool.rs
deleted file mode 100644
index 97cb7ec6..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/const_bool.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-pub const k: bool = true;
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct A {
-    pub _address: u8,
-}
-pub const A_k: bool = false;
-#[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;
-pub const k2: foo = true;
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/constant-evaluate.rs b/bindgen-tests/tests/expectations/tests/libclang-9/constant-evaluate.rs
deleted file mode 100644
index bbcf6d54..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/constant-evaluate.rs
+++ /dev/null
@@ -1,19 +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, Hash, PartialEq, Eq)]
-pub enum _bindgen_ty_1 {
-    foo = 4,
-    bar = 8,
-}
-pub type EasyToOverflow = ::std::os::raw::c_ulonglong;
-pub const k: EasyToOverflow = 2147483648;
-pub const k_expr: EasyToOverflow = 1152921504606846976;
-pub const wow: EasyToOverflow = 2147483648;
-pub const BAZ: ::std::os::raw::c_longlong = 24;
-pub const fuzz: f64 = 51.0;
-pub const BAZZ: ::std::os::raw::c_char = 53;
-pub const WAT: ::std::os::raw::c_char = 0;
-pub const bytestring: &[u8; 4] = b"Foo\0";
-pub const NOT_UTF8: &[u8; 5] = b"\xF0(\x8C(\0";
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/constified-enum-module-overflow.rs b/bindgen-tests/tests/expectations/tests/libclang-9/constified-enum-module-overflow.rs
new file mode 100644
index 00000000..49498dea
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-9/constified-enum-module-overflow.rs
@@ -0,0 +1,46 @@
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct B {
+    pub _address: u8,
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct C {
+    pub _address: u8,
+}
+pub type C_U = B;
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct A {
+    pub u: u8,
+}
+#[test]
+fn bindgen_test_layout_A() {
+    const UNINIT: ::std::mem::MaybeUninit<A> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
+    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)),
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize },
+        0usize,
+        concat!("Offset of field: ", stringify!(A), "::", stringify!(u)),
+    );
+}
+#[test]
+fn __bindgen_test_layout_C_open0_A_close0_instantiation() {
+    assert_eq!(
+        ::std::mem::size_of::<C>(),
+        1usize,
+        concat!("Size of template specialization: ", stringify!(C)),
+    );
+    assert_eq!(
+        ::std::mem::align_of::<C>(),
+        1usize,
+        concat!("Alignment of template specialization: ", stringify!(C)),
+    );
+}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/derive-hash-struct-with-incomplete-array.rs b/bindgen-tests/tests/expectations/tests/libclang-9/derive-hash-struct-with-incomplete-array.rs
deleted file mode 100644
index d1b4c900..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/derive-hash-struct-with-incomplete-array.rs
+++ /dev/null
@@ -1,154 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#[repr(C)]
-#[derive(Default)]
-pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
-impl<T> __IncompleteArrayField<T> {
-    #[inline]
-    pub const fn new() -> Self {
-        __IncompleteArrayField(::std::marker::PhantomData, [])
-    }
-    #[inline]
-    pub fn as_ptr(&self) -> *const T {
-        self as *const _ as *const T
-    }
-    #[inline]
-    pub fn as_mut_ptr(&mut self) -> *mut T {
-        self as *mut _ as *mut T
-    }
-    #[inline]
-    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
-        ::std::slice::from_raw_parts(self.as_ptr(), len)
-    }
-    #[inline]
-    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
-        ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
-    }
-}
-impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
-    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        fmt.write_str("__IncompleteArrayField")
-    }
-}
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct test {
-    pub a: ::std::os::raw::c_int,
-    pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_test() {
-    const UNINIT: ::std::mem::MaybeUninit<test> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<test>(),
-        4usize,
-        concat!("Size of: ", stringify!(test)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<test>(),
-        4usize,
-        concat!("Alignment of ", stringify!(test)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(test), "::", stringify!(a)),
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(test),
-            "::",
-            stringify!(zero_length_array),
-        ),
-    );
-}
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct test2 {
-    pub a: ::std::os::raw::c_int,
-    pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_test2() {
-    const UNINIT: ::std::mem::MaybeUninit<test2> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<test2>(),
-        4usize,
-        concat!("Size of: ", stringify!(test2)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<test2>(),
-        4usize,
-        concat!("Alignment of ", stringify!(test2)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(test2), "::", stringify!(a)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(test2),
-            "::",
-            stringify!(incomplete_array),
-        ),
-    );
-}
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct test3 {
-    pub a: ::std::os::raw::c_int,
-    pub zero_length_array: __IncompleteArrayField<::std::os::raw::c_char>,
-    pub incomplete_array: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_test3() {
-    const UNINIT: ::std::mem::MaybeUninit<test3> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<test3>(),
-        4usize,
-        concat!("Size of: ", stringify!(test3)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<test3>(),
-        4usize,
-        concat!("Alignment of ", stringify!(test3)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(test3), "::", stringify!(a)),
-    );
-    assert_eq!(
-        unsafe {
-            ::std::ptr::addr_of!((*ptr).zero_length_array) as usize - ptr as usize
-        },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(test3),
-            "::",
-            stringify!(zero_length_array),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).incomplete_array) as usize - ptr as usize },
-        4usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(test3),
-            "::",
-            stringify!(incomplete_array),
-        ),
-    );
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/error-E0600-cannot-apply-unary-negation-to-u32.rs b/bindgen-tests/tests/expectations/tests/libclang-9/error-E0600-cannot-apply-unary-negation-to-u32.rs
deleted file mode 100644
index 79004238..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/error-E0600-cannot-apply-unary-negation-to-u32.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#![allow(overflowing_literals)]
-pub const a: u32 = 4294967291;
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/incomplete-array-padding.rs b/bindgen-tests/tests/expectations/tests/libclang-9/incomplete-array-padding.rs
deleted file mode 100644
index c8038e1f..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/incomplete-array-padding.rs
+++ /dev/null
@@ -1,180 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#[repr(C)]
-#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
-pub struct __BindgenBitfieldUnit<Storage> {
-    storage: Storage,
-}
-impl<Storage> __BindgenBitfieldUnit<Storage> {
-    #[inline]
-    pub const fn new(storage: Storage) -> Self {
-        Self { storage }
-    }
-}
-impl<Storage> __BindgenBitfieldUnit<Storage>
-where
-    Storage: AsRef<[u8]> + AsMut<[u8]>,
-{
-    #[inline]
-    pub fn get_bit(&self, index: usize) -> bool {
-        debug_assert!(index / 8 < self.storage.as_ref().len());
-        let byte_index = index / 8;
-        let byte = self.storage.as_ref()[byte_index];
-        let bit_index = if cfg!(target_endian = "big") {
-            7 - (index % 8)
-        } else {
-            index % 8
-        };
-        let mask = 1 << bit_index;
-        byte & mask == mask
-    }
-    #[inline]
-    pub fn set_bit(&mut self, index: usize, val: bool) {
-        debug_assert!(index / 8 < self.storage.as_ref().len());
-        let byte_index = index / 8;
-        let byte = &mut self.storage.as_mut()[byte_index];
-        let bit_index = if cfg!(target_endian = "big") {
-            7 - (index % 8)
-        } else {
-            index % 8
-        };
-        let mask = 1 << bit_index;
-        if val {
-            *byte |= mask;
-        } else {
-            *byte &= !mask;
-        }
-    }
-    #[inline]
-    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
-        debug_assert!(bit_width <= 64);
-        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
-        debug_assert!(
-            (bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len(),
-        );
-        let mut val = 0;
-        for i in 0..(bit_width as usize) {
-            if self.get_bit(i + bit_offset) {
-                let index = if cfg!(target_endian = "big") {
-                    bit_width as usize - 1 - i
-                } else {
-                    i
-                };
-                val |= 1 << index;
-            }
-        }
-        val
-    }
-    #[inline]
-    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
-        debug_assert!(bit_width <= 64);
-        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
-        debug_assert!(
-            (bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len(),
-        );
-        for i in 0..(bit_width as usize) {
-            let mask = 1 << i;
-            let val_bit_is_set = val & mask == mask;
-            let index = if cfg!(target_endian = "big") {
-                bit_width as usize - 1 - i
-            } else {
-                i
-            };
-            self.set_bit(index + bit_offset, val_bit_is_set);
-        }
-    }
-}
-#[repr(C)]
-#[derive(Default)]
-pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
-impl<T> __IncompleteArrayField<T> {
-    #[inline]
-    pub const fn new() -> Self {
-        __IncompleteArrayField(::std::marker::PhantomData, [])
-    }
-    #[inline]
-    pub fn as_ptr(&self) -> *const T {
-        self as *const _ as *const T
-    }
-    #[inline]
-    pub fn as_mut_ptr(&mut self) -> *mut T {
-        self as *mut _ as *mut T
-    }
-    #[inline]
-    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
-        ::std::slice::from_raw_parts(self.as_ptr(), len)
-    }
-    #[inline]
-    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
-        ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
-    }
-}
-impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
-    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        fmt.write_str("__IncompleteArrayField")
-    }
-}
-#[repr(C)]
-#[derive(Debug)]
-pub struct foo {
-    pub _bitfield_align_1: [u8; 0],
-    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
-    pub b: __IncompleteArrayField<*mut ::std::os::raw::c_void>,
-}
-#[test]
-fn bindgen_test_layout_foo() {
-    const UNINIT: ::std::mem::MaybeUninit<foo> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<foo>(),
-        8usize,
-        concat!("Size of: ", stringify!(foo)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<foo>(),
-        8usize,
-        concat!("Alignment of ", stringify!(foo)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize },
-        8usize,
-        concat!("Offset of field: ", stringify!(foo), "::", stringify!(b)),
-    );
-}
-impl Default for foo {
-    fn default() -> Self {
-        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-        unsafe {
-            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-            s.assume_init()
-        }
-    }
-}
-impl foo {
-    #[inline]
-    pub fn a(&self) -> ::std::os::raw::c_char {
-        unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
-    }
-    #[inline]
-    pub fn set_a(&mut self, val: ::std::os::raw::c_char) {
-        unsafe {
-            let val: u8 = ::std::mem::transmute(val);
-            self._bitfield_1.set(0usize, 1u8, val as u64)
-        }
-    }
-    #[inline]
-    pub fn new_bitfield_1(
-        a: ::std::os::raw::c_char,
-    ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
-        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
-        __bindgen_bitfield_unit
-            .set(
-                0usize,
-                1u8,
-                {
-                    let a: u8 = unsafe { ::std::mem::transmute(a) };
-                    a as u64
-                },
-            );
-        __bindgen_bitfield_unit
-    }
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/issue-544-stylo-creduce-2.rs b/bindgen-tests/tests/expectations/tests/libclang-9/issue-544-stylo-creduce-2.rs
new file mode 100644
index 00000000..5c5ad156
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-9/issue-544-stylo-creduce-2.rs
@@ -0,0 +1,17 @@
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct Foo {
+    pub member: *mut [u8; 0usize],
+}
+pub type Foo_FirstAlias = [u8; 0usize];
+pub type Foo_SecondAlias = [u8; 0usize];
+impl Default for Foo {
+    fn default() -> Self {
+        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
+        unsafe {
+            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+            s.assume_init()
+        }
+    }
+}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/issue-643-inner-struct.rs b/bindgen-tests/tests/expectations/tests/libclang-9/issue-643-inner-struct.rs
deleted file mode 100644
index 520b3b0e..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/issue-643-inner-struct.rs
+++ /dev/null
@@ -1,148 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#[repr(C)]
-#[derive(Default)]
-pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
-impl<T> __IncompleteArrayField<T> {
-    #[inline]
-    pub const fn new() -> Self {
-        __IncompleteArrayField(::std::marker::PhantomData, [])
-    }
-    #[inline]
-    pub fn as_ptr(&self) -> *const T {
-        self as *const _ as *const T
-    }
-    #[inline]
-    pub fn as_mut_ptr(&mut self) -> *mut T {
-        self as *mut _ as *mut T
-    }
-    #[inline]
-    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
-        ::std::slice::from_raw_parts(self.as_ptr(), len)
-    }
-    #[inline]
-    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
-        ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
-    }
-}
-impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
-    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        fmt.write_str("__IncompleteArrayField")
-    }
-}
-#[repr(C)]
-#[derive(Debug)]
-pub struct rte_ring {
-    pub memzone: *mut rte_memzone,
-    pub prod: rte_ring_prod,
-    pub cons: rte_ring_cons,
-    pub ring: __IncompleteArrayField<*mut ::std::os::raw::c_void>,
-}
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct rte_ring_prod {
-    pub watermark: ::std::os::raw::c_uint,
-}
-#[test]
-fn bindgen_test_layout_rte_ring_prod() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_ring_prod> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_ring_prod>(),
-        4usize,
-        concat!("Size of: ", stringify!(rte_ring_prod)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_ring_prod>(),
-        4usize,
-        concat!("Alignment of ", stringify!(rte_ring_prod)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).watermark) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(rte_ring_prod),
-            "::",
-            stringify!(watermark),
-        ),
-    );
-}
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct rte_ring_cons {
-    pub sc_dequeue: ::std::os::raw::c_uint,
-}
-#[test]
-fn bindgen_test_layout_rte_ring_cons() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_ring_cons> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_ring_cons>(),
-        4usize,
-        concat!("Size of: ", stringify!(rte_ring_cons)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_ring_cons>(),
-        4usize,
-        concat!("Alignment of ", stringify!(rte_ring_cons)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).sc_dequeue) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(rte_ring_cons),
-            "::",
-            stringify!(sc_dequeue),
-        ),
-    );
-}
-#[test]
-fn bindgen_test_layout_rte_ring() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_ring> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_ring>(),
-        16usize,
-        concat!("Size of: ", stringify!(rte_ring)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_ring>(),
-        8usize,
-        concat!("Alignment of ", stringify!(rte_ring)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).memzone) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(rte_ring), "::", stringify!(memzone)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).prod) as usize - ptr as usize },
-        8usize,
-        concat!("Offset of field: ", stringify!(rte_ring), "::", stringify!(prod)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).cons) as usize - ptr as usize },
-        12usize,
-        concat!("Offset of field: ", stringify!(rte_ring), "::", stringify!(cons)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).ring) as usize - ptr as usize },
-        16usize,
-        concat!("Offset of field: ", stringify!(rte_ring), "::", stringify!(ring)),
-    );
-}
-impl Default for rte_ring {
-    fn default() -> Self {
-        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-        unsafe {
-            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-            s.assume_init()
-        }
-    }
-}
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct rte_memzone {
-    pub _address: u8,
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/issue-769-bad-instantiation-test.rs b/bindgen-tests/tests/expectations/tests/libclang-9/issue-769-bad-instantiation-test.rs
deleted file mode 100644
index ef830ca6..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/issue-769-bad-instantiation-test.rs
+++ /dev/null
@@ -1,60 +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 {
-            let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-            unsafe {
-                ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-                s.assume_init()
-            }
-        }
-    }
-    pub type AutoValueVector_Alias = ::std::os::raw::c_int;
-    #[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_AutoValueVector_Alias_close0_instantiation() {
-        assert_eq!(
-            ::std::mem::size_of::<root::Rooted<root::AutoValueVector_Alias>>(),
-            4usize,
-            concat!(
-                "Size of template specialization: ",
-                stringify!(root::Rooted < root::AutoValueVector_Alias >),
-            ),
-        );
-        assert_eq!(
-            ::std::mem::align_of::<root::Rooted<root::AutoValueVector_Alias>>(),
-            4usize,
-            concat!(
-                "Alignment of template specialization: ",
-                stringify!(root::Rooted < root::AutoValueVector_Alias >),
-            ),
-        );
-    }
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/layout_align.rs b/bindgen-tests/tests/expectations/tests/libclang-9/layout_align.rs
deleted file mode 100644
index be77dc75..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/layout_align.rs
+++ /dev/null
@@ -1,291 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#[repr(C)]
-#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
-pub struct __BindgenBitfieldUnit<Storage> {
-    storage: Storage,
-}
-impl<Storage> __BindgenBitfieldUnit<Storage> {
-    #[inline]
-    pub const fn new(storage: Storage) -> Self {
-        Self { storage }
-    }
-}
-impl<Storage> __BindgenBitfieldUnit<Storage>
-where
-    Storage: AsRef<[u8]> + AsMut<[u8]>,
-{
-    #[inline]
-    pub fn get_bit(&self, index: usize) -> bool {
-        debug_assert!(index / 8 < self.storage.as_ref().len());
-        let byte_index = index / 8;
-        let byte = self.storage.as_ref()[byte_index];
-        let bit_index = if cfg!(target_endian = "big") {
-            7 - (index % 8)
-        } else {
-            index % 8
-        };
-        let mask = 1 << bit_index;
-        byte & mask == mask
-    }
-    #[inline]
-    pub fn set_bit(&mut self, index: usize, val: bool) {
-        debug_assert!(index / 8 < self.storage.as_ref().len());
-        let byte_index = index / 8;
-        let byte = &mut self.storage.as_mut()[byte_index];
-        let bit_index = if cfg!(target_endian = "big") {
-            7 - (index % 8)
-        } else {
-            index % 8
-        };
-        let mask = 1 << bit_index;
-        if val {
-            *byte |= mask;
-        } else {
-            *byte &= !mask;
-        }
-    }
-    #[inline]
-    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
-        debug_assert!(bit_width <= 64);
-        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
-        debug_assert!(
-            (bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len(),
-        );
-        let mut val = 0;
-        for i in 0..(bit_width as usize) {
-            if self.get_bit(i + bit_offset) {
-                let index = if cfg!(target_endian = "big") {
-                    bit_width as usize - 1 - i
-                } else {
-                    i
-                };
-                val |= 1 << index;
-            }
-        }
-        val
-    }
-    #[inline]
-    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
-        debug_assert!(bit_width <= 64);
-        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
-        debug_assert!(
-            (bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len(),
-        );
-        for i in 0..(bit_width as usize) {
-            let mask = 1 << i;
-            let val_bit_is_set = val & mask == mask;
-            let index = if cfg!(target_endian = "big") {
-                bit_width as usize - 1 - i
-            } else {
-                i
-            };
-            self.set_bit(index + bit_offset, val_bit_is_set);
-        }
-    }
-}
-#[repr(C)]
-#[derive(Default)]
-pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
-impl<T> __IncompleteArrayField<T> {
-    #[inline]
-    pub const fn new() -> Self {
-        __IncompleteArrayField(::std::marker::PhantomData, [])
-    }
-    #[inline]
-    pub fn as_ptr(&self) -> *const T {
-        self as *const _ as *const T
-    }
-    #[inline]
-    pub fn as_mut_ptr(&mut self) -> *mut T {
-        self as *mut _ as *mut T
-    }
-    #[inline]
-    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
-        ::std::slice::from_raw_parts(self.as_ptr(), len)
-    }
-    #[inline]
-    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
-        ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
-    }
-}
-impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
-    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        fmt.write_str("__IncompleteArrayField")
-    }
-}
-#[repr(C)]
-#[derive(Debug)]
-pub struct rte_kni_fifo {
-    ///< Next position to be written
-    pub write: ::std::os::raw::c_uint,
-    ///< Next position to be read
-    pub read: ::std::os::raw::c_uint,
-    ///< Circular buffer length
-    pub len: ::std::os::raw::c_uint,
-    ///< Pointer size - for 32/64 bit OS
-    pub elem_size: ::std::os::raw::c_uint,
-    ///< The buffer contains mbuf pointers
-    pub buffer: __IncompleteArrayField<*mut ::std::os::raw::c_void>,
-}
-#[test]
-fn bindgen_test_layout_rte_kni_fifo() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_kni_fifo> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_kni_fifo>(),
-        16usize,
-        concat!("Size of: ", stringify!(rte_kni_fifo)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_kni_fifo>(),
-        8usize,
-        concat!("Alignment of ", stringify!(rte_kni_fifo)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).write) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(rte_kni_fifo), "::", stringify!(write)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize },
-        4usize,
-        concat!("Offset of field: ", stringify!(rte_kni_fifo), "::", stringify!(read)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
-        8usize,
-        concat!("Offset of field: ", stringify!(rte_kni_fifo), "::", stringify!(len)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).elem_size) as usize - ptr as usize },
-        12usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(rte_kni_fifo),
-            "::",
-            stringify!(elem_size),
-        ),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize },
-        16usize,
-        concat!("Offset of field: ", stringify!(rte_kni_fifo), "::", stringify!(buffer)),
-    );
-}
-impl Default for rte_kni_fifo {
-    fn default() -> Self {
-        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-        unsafe {
-            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-            s.assume_init()
-        }
-    }
-}
-#[repr(C)]
-#[repr(align(8))]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct rte_eth_link {
-    ///< ETH_SPEED_NUM_
-    pub link_speed: u32,
-    pub _bitfield_align_1: [u8; 0],
-    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
-    pub __bindgen_padding_0: [u8; 3usize],
-}
-#[test]
-fn bindgen_test_layout_rte_eth_link() {
-    const UNINIT: ::std::mem::MaybeUninit<rte_eth_link> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<rte_eth_link>(),
-        8usize,
-        concat!("Size of: ", stringify!(rte_eth_link)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<rte_eth_link>(),
-        8usize,
-        concat!("Alignment of ", stringify!(rte_eth_link)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).link_speed) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(rte_eth_link),
-            "::",
-            stringify!(link_speed),
-        ),
-    );
-}
-impl rte_eth_link {
-    #[inline]
-    pub fn link_duplex(&self) -> u16 {
-        unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) }
-    }
-    #[inline]
-    pub fn set_link_duplex(&mut self, val: u16) {
-        unsafe {
-            let val: u16 = ::std::mem::transmute(val);
-            self._bitfield_1.set(0usize, 1u8, val as u64)
-        }
-    }
-    #[inline]
-    pub fn link_autoneg(&self) -> u16 {
-        unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) }
-    }
-    #[inline]
-    pub fn set_link_autoneg(&mut self, val: u16) {
-        unsafe {
-            let val: u16 = ::std::mem::transmute(val);
-            self._bitfield_1.set(1usize, 1u8, val as u64)
-        }
-    }
-    #[inline]
-    pub fn link_status(&self) -> u16 {
-        unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) }
-    }
-    #[inline]
-    pub fn set_link_status(&mut self, val: u16) {
-        unsafe {
-            let val: u16 = ::std::mem::transmute(val);
-            self._bitfield_1.set(2usize, 1u8, val as u64)
-        }
-    }
-    #[inline]
-    pub fn new_bitfield_1(
-        link_duplex: u16,
-        link_autoneg: u16,
-        link_status: u16,
-    ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
-        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
-        __bindgen_bitfield_unit
-            .set(
-                0usize,
-                1u8,
-                {
-                    let link_duplex: u16 = unsafe { ::std::mem::transmute(link_duplex) };
-                    link_duplex as u64
-                },
-            );
-        __bindgen_bitfield_unit
-            .set(
-                1usize,
-                1u8,
-                {
-                    let link_autoneg: u16 = unsafe {
-                        ::std::mem::transmute(link_autoneg)
-                    };
-                    link_autoneg as u64
-                },
-            );
-        __bindgen_bitfield_unit
-            .set(
-                2usize,
-                1u8,
-                {
-                    let link_status: u16 = unsafe { ::std::mem::transmute(link_status) };
-                    link_status as u64
-                },
-            );
-        __bindgen_bitfield_unit
-    }
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/mangling-win32.rs b/bindgen-tests/tests/expectations/tests/libclang-9/mangling-win32.rs
deleted file mode 100644
index 34efb924..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/mangling-win32.rs
+++ /dev/null
@@ -1,46 +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 "fastcall" {
-    pub fn fast_call_func_no_args() -> ::std::os::raw::c_int;
-}
-extern "fastcall" {
-    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 "stdcall" {
-    pub fn std_call_func_no_args() -> ::std::os::raw::c_int;
-}
-extern "stdcall" {
-    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;
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/objc_inheritance.rs b/bindgen-tests/tests/expectations/tests/libclang-9/objc_inheritance.rs
deleted file mode 100644
index 6fb4e6b8..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/objc_inheritance.rs
+++ /dev/null
@@ -1,107 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#![cfg(target_os = "macos")]
-use objc::{self, msg_send, sel, sel_impl, class};
-#[allow(non_camel_case_types)]
-pub type id = *mut objc::runtime::Object;
-#[repr(transparent)]
-#[derive(Debug, Copy, Clone)]
-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!(class!(Foo), alloc) })
-    }
-}
-impl IFoo for Foo {}
-pub trait IFoo: Sized + std::ops::Deref {}
-#[repr(transparent)]
-#[derive(Debug, Copy, Clone)]
-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!(class!(Bar), alloc) })
-    }
-}
-impl IFoo for Bar {}
-impl From<Bar> for Foo {
-    fn from(child: Bar) -> Foo {
-        Foo(child.0)
-    }
-}
-impl std::convert::TryFrom<Foo> for Bar {
-    type Error = &'static str;
-    fn try_from(parent: Foo) -> Result<Bar, Self::Error> {
-        let is_kind_of: bool = unsafe { msg_send!(parent, isKindOfClass : class!(Bar)) };
-        if is_kind_of {
-            Ok(Bar(parent.0))
-        } else {
-            Err("This Foo cannot be downcasted to Bar")
-        }
-    }
-}
-impl IBar for Bar {}
-pub trait IBar: Sized + std::ops::Deref {}
-#[repr(transparent)]
-#[derive(Debug, Copy, Clone)]
-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!(class!(Baz), alloc) })
-    }
-}
-impl IBar for Baz {}
-impl From<Baz> for Bar {
-    fn from(child: Baz) -> Bar {
-        Bar(child.0)
-    }
-}
-impl std::convert::TryFrom<Bar> for Baz {
-    type Error = &'static str;
-    fn try_from(parent: Bar) -> Result<Baz, Self::Error> {
-        let is_kind_of: bool = unsafe { msg_send!(parent, isKindOfClass : class!(Baz)) };
-        if is_kind_of {
-            Ok(Baz(parent.0))
-        } else {
-            Err("This Bar cannot be downcasted to Baz")
-        }
-    }
-}
-impl IFoo for Baz {}
-impl From<Baz> for Foo {
-    fn from(child: Baz) -> Foo {
-        Foo(child.0)
-    }
-}
-impl std::convert::TryFrom<Foo> for Baz {
-    type Error = &'static str;
-    fn try_from(parent: Foo) -> Result<Baz, Self::Error> {
-        let is_kind_of: bool = unsafe { msg_send!(parent, isKindOfClass : class!(Baz)) };
-        if is_kind_of {
-            Ok(Baz(parent.0))
-        } else {
-            Err("This Foo cannot be downcasted to Baz")
-        }
-    }
-}
-impl IBaz for Baz {}
-pub trait IBaz: Sized + std::ops::Deref {}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/partial-specialization-and-inheritance.rs b/bindgen-tests/tests/expectations/tests/libclang-9/partial-specialization-and-inheritance.rs
deleted file mode 100644
index 3ba3a82a..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/partial-specialization-and-inheritance.rs
+++ /dev/null
@@ -1,33 +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)),
-    );
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/struct_typedef_ns.rs b/bindgen-tests/tests/expectations/tests/libclang-9/struct_typedef_ns.rs
new file mode 100644
index 00000000..44afa482
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-9/struct_typedef_ns.rs
@@ -0,0 +1,87 @@
+#![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;
+    pub mod whatever {
+        #[allow(unused_imports)]
+        use self::super::super::root;
+        #[repr(C)]
+        #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+        pub struct typedef_struct {
+            pub foo: ::std::os::raw::c_int,
+        }
+        #[test]
+        fn bindgen_test_layout_typedef_struct() {
+            const UNINIT: ::std::mem::MaybeUninit<typedef_struct> = ::std::mem::MaybeUninit::uninit();
+            let ptr = UNINIT.as_ptr();
+            assert_eq!(
+                ::std::mem::size_of::<typedef_struct>(),
+                4usize,
+                concat!("Size of: ", stringify!(typedef_struct)),
+            );
+            assert_eq!(
+                ::std::mem::align_of::<typedef_struct>(),
+                4usize,
+                concat!("Alignment of ", stringify!(typedef_struct)),
+            );
+            assert_eq!(
+                unsafe { ::std::ptr::addr_of!((*ptr).foo) as usize - ptr as usize },
+                0usize,
+                concat!(
+                    "Offset of field: ",
+                    stringify!(typedef_struct),
+                    "::",
+                    stringify!(foo),
+                ),
+            );
+        }
+        #[repr(u32)]
+        #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+        pub enum typedef_enum {
+            BAR = 1,
+        }
+    }
+    pub mod _bindgen_mod_id_12 {
+        #[allow(unused_imports)]
+        use self::super::super::root;
+        #[repr(C)]
+        #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+        pub struct _bindgen_ty_1 {
+            pub foo: ::std::os::raw::c_int,
+        }
+        #[test]
+        fn bindgen_test_layout__bindgen_ty_1() {
+            const UNINIT: ::std::mem::MaybeUninit<_bindgen_ty_1> = ::std::mem::MaybeUninit::uninit();
+            let ptr = UNINIT.as_ptr();
+            assert_eq!(
+                ::std::mem::size_of::<_bindgen_ty_1>(),
+                4usize,
+                concat!("Size of: ", stringify!(_bindgen_ty_1)),
+            );
+            assert_eq!(
+                ::std::mem::align_of::<_bindgen_ty_1>(),
+                4usize,
+                concat!("Alignment of ", stringify!(_bindgen_ty_1)),
+            );
+            assert_eq!(
+                unsafe { ::std::ptr::addr_of!((*ptr).foo) as usize - ptr as usize },
+                0usize,
+                concat!(
+                    "Offset of field: ",
+                    stringify!(_bindgen_ty_1),
+                    "::",
+                    stringify!(foo),
+                ),
+            );
+        }
+        pub type typedef_struct = root::_bindgen_mod_id_12::_bindgen_ty_1;
+        pub const _bindgen_mod_id_12_BAR: root::_bindgen_mod_id_12::_bindgen_ty_2 = _bindgen_ty_2::BAR;
+        #[repr(u32)]
+        #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+        pub enum _bindgen_ty_2 {
+            BAR = 1,
+        }
+        pub use self::super::super::root::_bindgen_mod_id_12::_bindgen_ty_2 as typedef_enum;
+    }
+}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/type_alias_template_specialized.rs b/bindgen-tests/tests/expectations/tests/libclang-9/type_alias_template_specialized.rs
deleted file mode 100644
index d585a857..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/type_alias_template_specialized.rs
+++ /dev/null
@@ -1,56 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct Rooted {
-    pub ptr: MaybeWrapped<::std::os::raw::c_int>,
-}
-#[test]
-fn bindgen_test_layout_Rooted() {
-    const UNINIT: ::std::mem::MaybeUninit<Rooted> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    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::addr_of!((*ptr).ptr) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(Rooted), "::", stringify!(ptr)),
-    );
-}
-impl Default for Rooted {
-    fn default() -> Self {
-        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
-        unsafe {
-            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
-            s.assume_init()
-        }
-    }
-}
-/// <div rustbindgen replaces="MaybeWrapped"></div>
-pub type MaybeWrapped<a> = a;
-#[test]
-fn __bindgen_test_layout_MaybeWrapped_open0_int_close0_instantiation() {
-    assert_eq!(
-        ::std::mem::size_of::<MaybeWrapped<::std::os::raw::c_int>>(),
-        4usize,
-        concat!(
-            "Size of template specialization: ",
-            stringify!(MaybeWrapped < ::std::os::raw::c_int >),
-        ),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<MaybeWrapped<::std::os::raw::c_int>>(),
-        4usize,
-        concat!(
-            "Alignment of template specialization: ",
-            stringify!(MaybeWrapped < ::std::os::raw::c_int >),
-        ),
-    );
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/zero-sized-array.rs b/bindgen-tests/tests/expectations/tests/libclang-9/zero-sized-array.rs
deleted file mode 100644
index bc4b6600..00000000
--- a/bindgen-tests/tests/expectations/tests/libclang-9/zero-sized-array.rs
+++ /dev/null
@@ -1,170 +0,0 @@
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#[repr(C)]
-#[derive(Default)]
-pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
-impl<T> __IncompleteArrayField<T> {
-    #[inline]
-    pub const fn new() -> Self {
-        __IncompleteArrayField(::std::marker::PhantomData, [])
-    }
-    #[inline]
-    pub fn as_ptr(&self) -> *const T {
-        self as *const _ as *const T
-    }
-    #[inline]
-    pub fn as_mut_ptr(&mut self) -> *mut T {
-        self as *mut _ as *mut T
-    }
-    #[inline]
-    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
-        ::std::slice::from_raw_parts(self.as_ptr(), len)
-    }
-    #[inline]
-    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
-        ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
-    }
-}
-impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
-    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        fmt.write_str("__IncompleteArrayField")
-    }
-}
-/// Bizarrely enough, this should *not* get an `_address` field.
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct ZeroSizedArray {
-    pub arr: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_ZeroSizedArray() {
-    const UNINIT: ::std::mem::MaybeUninit<ZeroSizedArray> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<ZeroSizedArray>(),
-        0usize,
-        concat!("Size of: ", stringify!(ZeroSizedArray)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<ZeroSizedArray>(),
-        1usize,
-        concat!("Alignment of ", stringify!(ZeroSizedArray)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).arr) as usize - ptr as usize },
-        0usize,
-        concat!("Offset of field: ", stringify!(ZeroSizedArray), "::", stringify!(arr)),
-    );
-}
-/// And nor should this get an `_address` field.
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct ContainsZeroSizedArray {
-    pub zsa: ZeroSizedArray,
-}
-#[test]
-fn bindgen_test_layout_ContainsZeroSizedArray() {
-    const UNINIT: ::std::mem::MaybeUninit<ContainsZeroSizedArray> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<ContainsZeroSizedArray>(),
-        0usize,
-        concat!("Size of: ", stringify!(ContainsZeroSizedArray)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<ContainsZeroSizedArray>(),
-        1usize,
-        concat!("Alignment of ", stringify!(ContainsZeroSizedArray)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).zsa) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(ContainsZeroSizedArray),
-            "::",
-            stringify!(zsa),
-        ),
-    );
-}
-/** Inheriting from ZeroSizedArray shouldn't cause an `_address` to be inserted
- either.*/
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct InheritsZeroSizedArray {
-    pub _base: ZeroSizedArray,
-}
-#[test]
-fn bindgen_test_layout_InheritsZeroSizedArray() {
-    assert_eq!(
-        ::std::mem::size_of::<InheritsZeroSizedArray>(),
-        0usize,
-        concat!("Size of: ", stringify!(InheritsZeroSizedArray)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<InheritsZeroSizedArray>(),
-        1usize,
-        concat!("Alignment of ", stringify!(InheritsZeroSizedArray)),
-    );
-}
-/// And this should not get an `_address` field either.
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct DynamicallySizedArray {
-    pub arr: __IncompleteArrayField<::std::os::raw::c_char>,
-}
-#[test]
-fn bindgen_test_layout_DynamicallySizedArray() {
-    const UNINIT: ::std::mem::MaybeUninit<DynamicallySizedArray> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<DynamicallySizedArray>(),
-        0usize,
-        concat!("Size of: ", stringify!(DynamicallySizedArray)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<DynamicallySizedArray>(),
-        1usize,
-        concat!("Alignment of ", stringify!(DynamicallySizedArray)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).arr) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(DynamicallySizedArray),
-            "::",
-            stringify!(arr),
-        ),
-    );
-}
-/// No `_address` field here either.
-#[repr(C)]
-#[derive(Debug, Default)]
-pub struct ContainsDynamicallySizedArray {
-    pub dsa: DynamicallySizedArray,
-}
-#[test]
-fn bindgen_test_layout_ContainsDynamicallySizedArray() {
-    const UNINIT: ::std::mem::MaybeUninit<ContainsDynamicallySizedArray> = ::std::mem::MaybeUninit::uninit();
-    let ptr = UNINIT.as_ptr();
-    assert_eq!(
-        ::std::mem::size_of::<ContainsDynamicallySizedArray>(),
-        0usize,
-        concat!("Size of: ", stringify!(ContainsDynamicallySizedArray)),
-    );
-    assert_eq!(
-        ::std::mem::align_of::<ContainsDynamicallySizedArray>(),
-        1usize,
-        concat!("Alignment of ", stringify!(ContainsDynamicallySizedArray)),
-    );
-    assert_eq!(
-        unsafe { ::std::ptr::addr_of!((*ptr).dsa) as usize - ptr as usize },
-        0usize,
-        concat!(
-            "Offset of field: ",
-            stringify!(ContainsDynamicallySizedArray),
-            "::",
-            stringify!(dsa),
-        ),
-    );
-}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/mangling-win32.rs b/bindgen-tests/tests/expectations/tests/mangling-win32.rs
similarity index 100%
rename from bindgen-tests/tests/expectations/tests/libclang-5/mangling-win32.rs
rename to bindgen-tests/tests/expectations/tests/mangling-win32.rs
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/objc_inheritance.rs b/bindgen-tests/tests/expectations/tests/objc_inheritance.rs
similarity index 100%
rename from bindgen-tests/tests/expectations/tests/libclang-5/objc_inheritance.rs
rename to bindgen-tests/tests/expectations/tests/objc_inheritance.rs
diff --git a/bindgen-tests/tests/expectations/tests/libclang-9/objc_template.rs b/bindgen-tests/tests/expectations/tests/objc_template.rs
similarity index 100%
rename from bindgen-tests/tests/expectations/tests/libclang-9/objc_template.rs
rename to bindgen-tests/tests/expectations/tests/objc_template.rs
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/partial-specialization-and-inheritance.rs b/bindgen-tests/tests/expectations/tests/partial-specialization-and-inheritance.rs
similarity index 100%
rename from bindgen-tests/tests/expectations/tests/libclang-5/partial-specialization-and-inheritance.rs
rename to bindgen-tests/tests/expectations/tests/partial-specialization-and-inheritance.rs
diff --git a/bindgen-tests/tests/expectations/tests/struct_typedef_ns.rs b/bindgen-tests/tests/expectations/tests/struct_typedef_ns.rs
index 44afa482..aabe23b1 100644
--- a/bindgen-tests/tests/expectations/tests/struct_typedef_ns.rs
+++ b/bindgen-tests/tests/expectations/tests/struct_typedef_ns.rs
@@ -47,41 +47,38 @@ pub mod root {
         use self::super::super::root;
         #[repr(C)]
         #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
-        pub struct _bindgen_ty_1 {
+        pub struct typedef_struct {
             pub foo: ::std::os::raw::c_int,
         }
         #[test]
-        fn bindgen_test_layout__bindgen_ty_1() {
-            const UNINIT: ::std::mem::MaybeUninit<_bindgen_ty_1> = ::std::mem::MaybeUninit::uninit();
+        fn bindgen_test_layout_typedef_struct() {
+            const UNINIT: ::std::mem::MaybeUninit<typedef_struct> = ::std::mem::MaybeUninit::uninit();
             let ptr = UNINIT.as_ptr();
             assert_eq!(
-                ::std::mem::size_of::<_bindgen_ty_1>(),
+                ::std::mem::size_of::<typedef_struct>(),
                 4usize,
-                concat!("Size of: ", stringify!(_bindgen_ty_1)),
+                concat!("Size of: ", stringify!(typedef_struct)),
             );
             assert_eq!(
-                ::std::mem::align_of::<_bindgen_ty_1>(),
+                ::std::mem::align_of::<typedef_struct>(),
                 4usize,
-                concat!("Alignment of ", stringify!(_bindgen_ty_1)),
+                concat!("Alignment of ", stringify!(typedef_struct)),
             );
             assert_eq!(
                 unsafe { ::std::ptr::addr_of!((*ptr).foo) as usize - ptr as usize },
                 0usize,
                 concat!(
                     "Offset of field: ",
-                    stringify!(_bindgen_ty_1),
+                    stringify!(typedef_struct),
                     "::",
                     stringify!(foo),
                 ),
             );
         }
-        pub type typedef_struct = root::_bindgen_mod_id_12::_bindgen_ty_1;
-        pub const _bindgen_mod_id_12_BAR: root::_bindgen_mod_id_12::_bindgen_ty_2 = _bindgen_ty_2::BAR;
         #[repr(u32)]
         #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-        pub enum _bindgen_ty_2 {
+        pub enum typedef_enum {
             BAR = 1,
         }
-        pub use self::super::super::root::_bindgen_mod_id_12::_bindgen_ty_2 as typedef_enum;
     }
 }
diff --git a/bindgen-tests/tests/expectations/tests/libclang-5/type_alias_template_specialized.rs b/bindgen-tests/tests/expectations/tests/type_alias_template_specialized.rs
similarity index 100%
rename from bindgen-tests/tests/expectations/tests/libclang-5/type_alias_template_specialized.rs
rename to bindgen-tests/tests/expectations/tests/type_alias_template_specialized.rs
diff --git a/bindgen-tests/tests/expectations/tests/zero-sized-array.rs b/bindgen-tests/tests/expectations/tests/zero-sized-array.rs
index b0a1d3e5..bc4b6600 100644
--- a/bindgen-tests/tests/expectations/tests/zero-sized-array.rs
+++ b/bindgen-tests/tests/expectations/tests/zero-sized-array.rs
@@ -114,6 +114,8 @@ pub struct DynamicallySizedArray {
 }
 #[test]
 fn bindgen_test_layout_DynamicallySizedArray() {
+    const UNINIT: ::std::mem::MaybeUninit<DynamicallySizedArray> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<DynamicallySizedArray>(),
         0usize,
@@ -124,6 +126,16 @@ fn bindgen_test_layout_DynamicallySizedArray() {
         1usize,
         concat!("Alignment of ", stringify!(DynamicallySizedArray)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).arr) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(DynamicallySizedArray),
+            "::",
+            stringify!(arr),
+        ),
+    );
 }
 /// No `_address` field here either.
 #[repr(C)]
@@ -133,6 +145,8 @@ pub struct ContainsDynamicallySizedArray {
 }
 #[test]
 fn bindgen_test_layout_ContainsDynamicallySizedArray() {
+    const UNINIT: ::std::mem::MaybeUninit<ContainsDynamicallySizedArray> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
     assert_eq!(
         ::std::mem::size_of::<ContainsDynamicallySizedArray>(),
         0usize,
@@ -143,4 +157,14 @@ fn bindgen_test_layout_ContainsDynamicallySizedArray() {
         1usize,
         concat!("Alignment of ", stringify!(ContainsDynamicallySizedArray)),
     );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).dsa) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(ContainsDynamicallySizedArray),
+            "::",
+            stringify!(dsa),
+        ),
+    );
 }
diff --git a/bindgen-tests/tests/headers/issue-544-stylo-creduce-2.hpp b/bindgen-tests/tests/headers/issue-544-stylo-creduce-2.hpp
index f3467f45..b41b422d 100644
--- a/bindgen-tests/tests/headers/issue-544-stylo-creduce-2.hpp
+++ b/bindgen-tests/tests/headers/issue-544-stylo-creduce-2.hpp
@@ -4,5 +4,12 @@ template <typename T>
 struct Foo {
     template <typename> using FirstAlias = typename T::Associated;
     template <typename U> using SecondAlias = Foo<FirstAlias<U>>;
+
+#if 0
+    // FIXME: This regressed sometime between libclang 9 and 16, though it
+    // never quite worked properly so...
     SecondAlias<int> member;
+#else
+    SecondAlias<int>* member;
+#endif
 };
diff --git a/bindgen-tests/tests/stylo_sanity.rs b/bindgen-tests/tests/stylo_sanity.rs
index e1ad86b0..e9ec69bc 100755
--- a/bindgen-tests/tests/stylo_sanity.rs
+++ b/bindgen-tests/tests/stylo_sanity.rs
@@ -19,8 +19,8 @@ extern crate bindgen;
     feature = "__testing_only_extra_assertions",
 )))]
 #[cfg(any(
-    feature = "__testing_only_libclang_5",
-    feature = "__testing_only_libclang_9"
+    feature = "__testing_only_libclang_9",
+    feature = "__testing_only_libclang_16"
 ))]
 fn sanity_check_can_generate_stylo_bindings() {
     use std::time::Instant;
diff --git a/bindgen-tests/tests/tests.rs b/bindgen-tests/tests/tests.rs
index 1913b874..bcc02b8d 100644
--- a/bindgen-tests/tests/tests.rs
+++ b/bindgen-tests/tests/tests.rs
@@ -148,21 +148,19 @@ fn compare_generated_header(
     {
         let mut expectation = expectation.clone();
 
-        if cfg!(feature = "__testing_only_libclang_9") {
+        if cfg!(feature = "__testing_only_libclang_16") {
+            expectation.push("libclang-16");
+        } else if cfg!(feature = "__testing_only_libclang_9") {
             expectation.push("libclang-9");
-        } else if cfg!(feature = "__testing_only_libclang_5") {
-            expectation.push("libclang-5");
         } else {
             match clang_version().parsed {
-                None => expectation.push("libclang-9"),
+                None => expectation.push("libclang-16"),
                 Some(version) => {
                     let (maj, min) = version;
-                    let version_str = if maj >= 9 {
+                    let version_str = if maj >= 16 {
+                        "16".to_owned()
+                    } else if maj >= 9 {
                         "9".to_owned()
-                    } else if maj >= 5 {
-                        "5".to_owned()
-                    } else if maj >= 4 {
-                        "4".to_owned()
                     } else {
                         format!("{}.{}", maj, min)
                     };
diff --git a/ci/test.sh b/ci/test.sh
index c0c8bec5..11e091f4 100755
--- a/ci/test.sh
+++ b/ci/test.sh
@@ -9,20 +9,22 @@ set -x
 set -o pipefail
 
 function llvm_linux_target_triple() {
-  echo "x86_64-linux-gnu-ubuntu-16.04"
+  case "$1" in
+    9.0.1)  echo "x86_64-linux-gnu-ubuntu-16.04" ;;
+    *)      echo "x86_64-linux-gnu-ubuntu-18.04" ;;
+  esac
 }
 
 function llvm_macos_target_triple() {
   case "$1" in
-    [0-8].* | 9.0.0)    echo "x86_64-darwin-apple" ;;
-    # Starting with 9.0.1, triple swapped ordering
-    *)                  echo "x86_64-apple-darwin" ;;
+    9.0.1)  echo "x86_64-apple-darwin" ;;
+    *)      echo "arm64-apple-darwin22.0" ;;
   esac
 }
 
 function llvm_version_triple() {
   case "$1" in
-    5.0) echo "5.0.1" ;;
+    9.0) echo "9.0.1" ;;
     # By default, take the .0 patch release
     *)   echo "$1.0"  ;;
   esac
@@ -30,16 +32,7 @@ function llvm_version_triple() {
 
 function llvm_base_url() {
   local llvm_version_triple=$1
-
-  case "$llvm_version_triple" in
-    [0-8].* | 9.0.0)
-      echo "http://releases.llvm.org/$llvm_version_triple"
-      ;;
-    # Starting with 9.0.1, releases are hosted on github
-    *)
-      echo "https://github.com/llvm/llvm-project/releases/download/llvmorg-$llvm_version_triple"
-      ;;
-  esac
+  echo "https://github.com/llvm/llvm-project/releases/download/llvmorg-$llvm_version_triple"
 }
 
 function llvm_download() {