Prevent inlining in gdb.base/vla-optimized-out.c
authorGary Benson <gbenson@redhat.com>
Tue, 10 Nov 2020 16:40:40 +0000 (16:40 +0000)
committerGary Benson <gbenson@redhat.com>
Tue, 10 Nov 2020 16:40:40 +0000 (16:40 +0000)
commit6ff174a7275512ce6f5c7a5496576a0531bd2c2f
treec656665e072211c50816418603bc55f494ec4504
parenteb24648c453c28f2898fb599311ba004394a8b41
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)).
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/vla-optimized-out.c