Prevent inlining in gdb.base/vla-optimized-out.c

The function f1 in gdb.base/vla-optimized-out.c sets various
attributes to prevent its being inlined, but Clang inlines it
anyway, causing the test that uses it to fail.  This commit
adds the "weak" attribute to cause Clang to keep the function
fully out of line so the test can operate as it should.

gdb/testsuite/ChangeLog:

	* gdb.base/vla-optimized-out.c (f1): Add __attribute__ ((weak)).
This commit is contained in:
Gary Benson
2020-11-10 16:40:40 +00:00
parent eb24648c45
commit 6ff174a727
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2020-11-10 Gary Benson <gbenson@redhat.com>
* gdb.base/vla-optimized-out.c (f1): Add __attribute__ ((weak)).
2020-11-10 Gary Benson <gbenson@redhat.com>
* gdb.cp/step-and-next-inline.exp: Only require

View File

@ -22,9 +22,9 @@
int
#ifdef NOCLONE
__attribute__((noinline)) ATTRIBUTE_NOCLONE
__attribute__((noinline,weak)) ATTRIBUTE_NOCLONE
#else
__attribute__((noinline))
__attribute__((noinline,weak))
#endif
f1 (int i)
{