diff --git a/integration-tests/src/tests.rs b/integration-tests/src/tests.rs index 31ef9f778..90568e5c5 100644 --- a/integration-tests/src/tests.rs +++ b/integration-tests/src/tests.rs @@ -5785,6 +5785,24 @@ fn test_shared_ptr() { ); } +#[test] +fn test_shared_ptr_const() { + let hdr = indoc! {" + #include + inline std::shared_ptr make_shared_int() { + return std::make_shared(3); + } + inline int take_shared_int(std::shared_ptr a) { + return *a; + } + "}; + let rs = quote! { + let a = ffi::make_shared_int(); + assert_eq!(ffi::take_shared_int(a.clone()), autocxx::c_int(3)); + }; + run_test("", hdr, rs, &["make_shared_int", "take_shared_int"], &[]); +} + #[test] fn test_rust_reference() { let hdr = indoc! {"