Fix testcases using __attribute__((noclone)) with Clang
authorGary Benson <gbenson@redhat.com>
Mon, 2 Nov 2020 11:52:41 +0000 (11:52 +0000)
committerGary Benson <gbenson@redhat.com>
Mon, 2 Nov 2020 11:52:41 +0000 (11:52 +0000)
commit7ea44a51faeb81644eeb14f06db15cfb4a65d59e
tree296dff3206b8fc96bfca3fa0a8f8d690d98f9fb4
parentab8f783d7ad51895d961b1bc6b82abcd8118e9a1
Fix testcases using __attribute__((noclone)) with Clang

Clang fails to compile a number of files with the following warning:
unknown attribute 'noclone' ignored [-Wunknown-attributes].  This
commit adds a new header, lib/noclone.h, which defines the macro
ATTRIBUTE_NOCLONE accordingly, and updates the relevant testcases
to use it.

gdb/testsuite/ChangeLog:

* lib/attributes.h: New header.
* gdb.base/backtrace.c: Include the above. Replace
__attribute__(noclone)) with ATTRIBUTE_NOCLONE.
* gdb.base/infcall-nested-structs.c: Likewise.
* gdb.base/vla-optimized-out.c: Likewise.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/backtrace.c
gdb/testsuite/gdb.base/infcall-nested-structs.c
gdb/testsuite/gdb.base/vla-optimized-out.c
gdb/testsuite/lib/attributes.h [new file with mode: 0644]