mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 18:08:24 +08:00
[gdb/testsuite] Fix gdb.opt/inline-small-func.exp with clang
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 `main': 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 ... Fix this by using __attribute__((always_inline)). Tested on x86_64-linux.
This commit is contained in:
@ -13,9 +13,15 @@
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define ATTR __attribute__((always_inline))
|
||||||
|
#else
|
||||||
|
#define ATTR
|
||||||
|
#endif
|
||||||
|
|
||||||
int counter = 42;
|
int counter = 42;
|
||||||
|
|
||||||
inline void
|
inline ATTR void
|
||||||
callee () {
|
callee () {
|
||||||
counter = 0; /* callee: body. */
|
counter = 0; /* callee: body. */
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user