ltmain.in: Use func_warning for all warnings
[libtool.git] / tests / duplicate_members.at
blob206aadf584453c43405dfdc92e732f19aa6346b0
1 # duplicate_members.at -- duplicate members in archive tests  -*- Autotest -*-
3 #   Copyright (C) 2005, 2007-2009, 2011-2019, 2021-2024 Free Software
4 #   Foundation, Inc.
5 #   Written by Alexandre Oliva & Peter O'Gorman, 2005
7 #   This file is part of GNU Libtool.
9 # GNU Libtool is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation; either version 2 of
12 # the License, or (at your option) any later version.
14 # GNU Libtool is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GNU Libtool; see the file COPYING.  If not, a copy
21 # can be downloaded from  http://www.gnu.org/licenses/gpl.html,
22 # or obtained by writing to the Free Software Foundation, Inc.,
23 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 ####
26 AT_SETUP([duplicate members in archive tests])
27 AT_KEYWORDS([libtool])
29 # we don't want to use whole_archive_flag_spec, even if available
30 $SED -e 's|^whole_archive_flag_spec=.*|whole_archive_flag_spec=|g' < $LIBTOOL > libtool
32 chmod +x ./libtool
33 LIBTOOL=./libtool
35 AT_DATA(bar.c,
36 [[extern int foo1 (), foo2 (), foo3 (), foo4 (), foo5 (), foo6 ();
37 int bar() {
38     int result = foo1 () + foo2 () + foo3 () + foo4 () + foo5 () + foo6 ();
39     return result;
41 ]])
43 AT_DATA(main.c,
44 [[int bar();
45 int main()
47 if (bar() == 21) return 0;
48 return 1;
50 ]])
53 for a in 1 2 3 4 5 6
55   mkdir $a
56   echo "int foo$a() {return $a;}" > $a/a.c
57 done
60 for a in 1 2 3 4 5 6
62   $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c -o $a/a.lo $a/a.c
63 done
64 $LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libc0.la 6/a.lo
65 AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libconv.la ]dnl
66          [1/a.lo 2/a.lo 3/a.lo 4/a.lo 5/a.lo libc0.la], [], [ignore], [ignore])
68 $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c -o bar.lo bar.c
69 AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libbar.la ]dnl
70          [ bar.lo libconv.la -rpath /notexist], [], [ignore], [ignore])
72 $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c -o main.lo main.c
73 AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o main$EXEEXT ]dnl
74          [main.lo ./libbar.la], [], [ignore], [ignore])
76 LT_AT_EXEC_CHECK([./main],[0],[ignore],[ignore])
78 AT_CLEANUP