From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 8B3583858D32; Tue, 26 Jul 2022 13:02:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B3583858D32 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.opt/inline-small-func.exp with clang X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: c138af95731c630a78329fd86076992f82099957 X-Git-Newrev: 206977b2edecbe086beb23a32c9c114e2d5af28d Message-Id: <20220726130221.8B3583858D32@sourceware.org> Date: Tue, 26 Jul 2022 13:02:21 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2022 13:02:21 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D206977b2edec= be086beb23a32c9c114e2d5af28d commit 206977b2edecbe086beb23a32c9c114e2d5af28d Author: Tom de Vries Date: Tue Jul 26 15:02:18 2022 +0200 [gdb/testsuite] Fix gdb.opt/inline-small-func.exp with clang =20 When running test-case gdb.opt/inline-small-func.exp with clang 12.0.1,= I run into: ... gdb compile failed, /usr/bin/ld: inline-small-func0.o: in function `mai= n': inline-small-func.c:21: undefined reference to `callee' clang-12.0: error: linker command failed with exit code 1 \ (use -v to see invocation) UNTESTED: gdb.opt/inline-small-func.exp: failed to prepare ... =20 Fix this by using __attribute__((always_inline)). =20 Tested on x86_64-linux. Diff: --- gdb/testsuite/gdb.opt/inline-small-func.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.opt/inline-small-func.h b/gdb/testsuite/gdb.= opt/inline-small-func.h index 66323952cf4..44b6e86fc15 100644 --- a/gdb/testsuite/gdb.opt/inline-small-func.h +++ b/gdb/testsuite/gdb.opt/inline-small-func.h @@ -13,9 +13,15 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . = */ =20 +#ifdef __GNUC__ +#define ATTR __attribute__((always_inline)) +#else +#define ATTR +#endif + int counter =3D 42; =20 -inline void +inline ATTR void callee () { counter =3D 0; /* callee: body. */ }