From 59ee8f01d4c0c64b50b66c6f99adf896f0703ad5 Mon Sep 17 00:00:00 2001 From: Adrian Taylor Date: Sun, 27 Nov 2022 08:05:06 +0000 Subject: [PATCH] Add test for problem returning const values. --- integration-tests/tests/integration_test.rs | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/integration-tests/tests/integration_test.rs b/integration-tests/tests/integration_test.rs index 374b2c94f..c151ed184 100644 --- a/integration-tests/tests/integration_test.rs +++ b/integration-tests/tests/integration_test.rs @@ -12089,6 +12089,28 @@ fn test_issue_1170() { run_test("", hdr, quote! {}, &["Arch"], &[]); } +#[ignore] // /~https://github.com/google/autocxx/issues/1191 +#[test] +fn test_return_const_int() { + let hdr = indoc! { + "inline const int get_value() { + return 3; + }" + }; + run_test("", hdr, quote! {}, &["get_value"], &[]); +} + +#[test] +fn test_return_const_struct() { + let hdr = indoc! { + "struct A { int a; }; + inline const A get_value() { + return A { 3 }; + }" + }; + run_test("", hdr, quote! {}, &["get_value", "A"], &[]); +} + // /~https://github.com/google/autocxx/issues/774 #[test] fn test_virtual_methods() {