blob: 3c469ff276aaf36f48c03c3f30fd64c5745bbdda [file] [log] [blame]
/* Copyright (C) 2019-2021 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef TEST_SHARED
/* A function in the shared library linked with this program. */
extern int shlib_function (void);
#else
#include <stdlib.h>
static int crashfunc_global = 4321;
static int
crashfunc (void)
{
abort ();
return crashfunc_global;
}
int
shlib_function (void)
{
return crashfunc ();
}
#endif
int
main (void)
{
int ret = shlib_function ();
return ret;
}