math: Regenerate s390 ulps
[glibc.git] / sysdeps / powerpc / powerpc64 / setjmp-bug21895.c
blob945a251d9576200b7953dc4abaf8651d5b1d5a57
1 /* Shared object part of test for setjmp interoperability with static
2 dlopen BZ #21895.
3 Copyright (C) 2017-2018 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
20 #include <string.h>
21 #include <setjmp.h>
23 /* Copy r1 adress to a local variable. */
24 #define GET_STACK_POINTER(sp) \
25 ({ \
26 asm volatile ("mr %0, 1\n\t" \
27 : "=r" (sp)); \
30 jmp_buf jb;
31 void (*bar)(jmp_buf, unsigned long);
33 void
34 lbar (unsigned long sp)
36 bar(jb, sp);
37 for(;;);
40 void
41 foo (void)
43 unsigned long sp;
44 /* Copy r1 (stack pointer) to sp. It will be use later to get
45 TOC area. */
46 GET_STACK_POINTER(sp);
47 setjmp(jb);
48 lbar(sp);
50 for(;;);