1 /* Test for re-exec with legacy bitmap.
2 Copyright (C) 2018-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
23 #include <support/check.h>
25 /* Nonzero if the program gets called via `exec'. */
28 #define CMDLINE_OPTIONS \
29 { "restart", no_argument, &restart, 1 },
31 extern int do_test (int argc
, char *argv
[]);
33 extern int in_dso_1 (void);
34 extern int in_dso_2 (void);
39 if (in_dso_1 () != 0x1234678)
41 puts ("in_dso_1 () != 0x1234678");
45 if (in_dso_2 () != 0xbadbeef)
47 puts ("in_dso_2 () != 0xbadbeef");
55 do_test (int argc
, char *argv
[])
58 - one or four parameters left if called initially
59 + path for ld.so optional
60 + "--library-path" optional
61 + the library path optional
62 + the application name
68 if (argc
!= 2 && argc
!= 5)
69 FAIL_EXIT1 ("wrong number of arguments (%d)", argc
);
72 execl (argv
[1], argv
[1], argv
[2], argv
[3], argv
[4], "--direct",
75 execl (argv
[1], argv
[1], "--direct", "--restart", NULL
);
80 #define TEST_FUNCTION_ARGV do_test
81 #include <support/test-driver.c>