1 /* Test CET property note parser for [BZ #23467].
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 extern void bar (void);
28 __attribute__ ((noclone
, noinline
))
29 test (void (*func_p
) (void))
34 /* bar contains an IBT violation if it is called indirectly via a
35 function pointer. On IBT machines, it should lead to segfault
36 unless IBT is disabled by error. */
39 sig_handler (int signo
)
49 if (scanf ("%3s", buf
) != 1)
50 FAIL_UNSUPPORTED ("IBT not supported");
52 if (strcmp (buf
, "IBT") != 0)
53 FAIL_UNSUPPORTED ("IBT not supported");
55 TEST_VERIFY_EXIT (signal (SIGSEGV
, &sig_handler
) != SIG_ERR
);
57 /* Call bar via a function pointer to force an IBT violation. */
63 #include <support/test-driver.c>