string: Hook up the default implementation on test-strcmp
[glibc.git] / nptl / tst-cleanup4aux.c
blob560280b6abfa35dec2e81898cf723c33d7511972
1 /* Copyright (C) 2003-2023 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */
18 #include <pthread.h>
19 #include <shlib-compat.h>
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <unistd.h>
24 extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer,
25 void (*__routine) (void *),
26 void *__arg);
27 compat_symbol_reference (libpthread, _pthread_cleanup_push,
28 _pthread_cleanup_push, GLIBC_2_0);
29 extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer,
30 int __execute);
31 compat_symbol_reference (libpthread, _pthread_cleanup_pop,
32 _pthread_cleanup_pop, GLIBC_2_0);
34 extern void clh (void *arg);
35 extern void fn0 (void);
36 extern void fn1 (void);
37 extern void fn5 (void);
38 extern void fn7 (void);
39 extern void fn9 (void);
42 static __attribute__((noinline)) void
43 fn3 (void)
45 /* This is the old LinuxThreads pthread_cleanup_{push,pop}. */
46 struct _pthread_cleanup_buffer b;
47 _pthread_cleanup_push (&b, clh, (void *) 4l);
49 fn0 ();
51 _pthread_cleanup_pop (&b, 1);
55 static __attribute__((noinline)) void
56 fn4 (void)
58 pthread_cleanup_push (clh, (void *) 5l);
60 fn3 ();
62 pthread_cleanup_pop (1);
66 void
67 fn5 (void)
69 /* This is the old LinuxThreads pthread_cleanup_{push,pop}. */
70 struct _pthread_cleanup_buffer b;
71 _pthread_cleanup_push (&b, clh, (void *) 6l);
73 fn4 ();
75 _pthread_cleanup_pop (&b, 1);
79 static __attribute__((noinline)) void
80 fn6 (void)
82 pthread_cleanup_push (clh, (void *) 7l);
84 fn0 ();
86 pthread_cleanup_pop (1);
90 void
91 fn7 (void)
93 /* This is the old LinuxThreads pthread_cleanup_{push,pop}. */
94 struct _pthread_cleanup_buffer b;
95 _pthread_cleanup_push (&b, clh, (void *) 8l);
97 fn6 ();
99 _pthread_cleanup_pop (&b, 1);
103 static __attribute__((noinline)) void
104 fn8 (void)
106 pthread_cleanup_push (clh, (void *) 9l);
108 fn1 ();
110 pthread_cleanup_pop (1);
114 void
115 fn9 (void)
117 /* This is the old LinuxThreads pthread_cleanup_{push,pop}. */
118 struct _pthread_cleanup_buffer b;
119 _pthread_cleanup_push (&b, clh, (void *) 10l);
121 fn8 ();
123 _pthread_cleanup_pop (&b, 1);