git: dd9ecc8730c8 - stable/15 - tests/fusefs: fix the build with gcc 16

From: Siva Mahadevan <siva_at_FreeBSD.org>
Date: Mon, 14 Sep 2026 14:21:46 UTC
The branch stable/15 has been updated by siva:

URL: https://cgit.FreeBSD.org/src/commit/?id=dd9ecc8730c89fa2a7c4c96d51f0f3c9bd0f8865

commit dd9ecc8730c89fa2a7c4c96d51f0f3c9bd0f8865
Author:     Siva Mahadevan <siva@FreeBSD.org>
AuthorDate: 2026-09-08 20:10:51 +0000
Commit:     Siva Mahadevan <siva@FreeBSD.org>
CommitDate: 2026-09-14 14:02:36 +0000

    tests/fusefs: fix the build with gcc 16
    
    Reviewed by:    asomers
    MFC after:      3 days
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 0e3dae1ca8fc371eb5c451032adc5e0813b00db6)
---
 tests/sys/fs/fusefs/Makefile | 7 +++++++
 tests/sys/fs/fusefs/utils.cc | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/sys/fs/fusefs/Makefile b/tests/sys/fs/fusefs/Makefile
index 42db0d36c957..94570c09970e 100644
--- a/tests/sys/fs/fusefs/Makefile
+++ b/tests/sys/fs/fusefs/Makefile
@@ -96,6 +96,13 @@ CXXWARNFLAGS+=	-Wno-vla-cxx-extension
 CXXFLAGS+=	-I${SRCTOP}/tests
 CXXFLAGS+=	-I${FUSEFS}
 
+.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 160000
+# gcc 16's aggressive inlining hits max-inline-insns-* limits and
+# fails on these sources. Use a lower optimization setting to
+# fix the build.
+CXXFLAGS+= -O1
+.endif
+
 LIBADD+=	pthread
 LIBADD+=	gmock gtest
 LIBADD+=	util
diff --git a/tests/sys/fs/fusefs/utils.cc b/tests/sys/fs/fusefs/utils.cc
index 125b7e2d6fc7..6f6bd1650848 100644
--- a/tests/sys/fs/fusefs/utils.cc
+++ b/tests/sys/fs/fusefs/utils.cc
@@ -182,7 +182,7 @@ void FuseTest::SetUp() {
 			_)
 		).Times(AnyNumber())
 		.WillRepeatedly(Invoke(ReturnErrno(ENOSYS)));
-	} catch (std::system_error err) {
+	} catch (std::system_error const& err) {
 		FAIL() << err.what();
 	}
 }