Forgot to add the ChangeLog to the previous commit, doh.
[glibc.git] / nptl / tst-cleanup4aux.c
blobc1800a85d4e018441a9fa9b403434c5f3b020a1a
1 /* Copyright (C) 2003-2016 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
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 <http://www.gnu.org/licenses/>. */
19 #include <pthread.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 extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer,
28 int __execute);
30 extern void clh (void *arg);
31 extern void fn0 (void);
32 extern void fn1 (void);
33 extern void fn5 (void);
34 extern void fn7 (void);
35 extern void fn9 (void);
38 static __attribute__((noinline)) void
39 fn3 (void)
41 /* This is the old LinuxThreads pthread_cleanup_{push,pop}. */
42 struct _pthread_cleanup_buffer b;
43 _pthread_cleanup_push (&b, clh, (void *) 4l);
45 fn0 ();
47 _pthread_cleanup_pop (&b, 1);
51 static __attribute__((noinline)) void
52 fn4 (void)
54 pthread_cleanup_push (clh, (void *) 5l);
56 fn3 ();
58 pthread_cleanup_pop (1);
62 void
63 fn5 (void)
65 /* This is the old LinuxThreads pthread_cleanup_{push,pop}. */
66 struct _pthread_cleanup_buffer b;
67 _pthread_cleanup_push (&b, clh, (void *) 6l);
69 fn4 ();
71 _pthread_cleanup_pop (&b, 1);
75 static __attribute__((noinline)) void
76 fn6 (void)
78 pthread_cleanup_push (clh, (void *) 7l);
80 fn0 ();
82 pthread_cleanup_pop (1);
86 void
87 fn7 (void)
89 /* This is the old LinuxThreads pthread_cleanup_{push,pop}. */
90 struct _pthread_cleanup_buffer b;
91 _pthread_cleanup_push (&b, clh, (void *) 8l);
93 fn6 ();
95 _pthread_cleanup_pop (&b, 1);
99 static __attribute__((noinline)) void
100 fn8 (void)
102 pthread_cleanup_push (clh, (void *) 9l);
104 fn1 ();
106 pthread_cleanup_pop (1);
110 void
111 fn9 (void)
113 /* This is the old LinuxThreads pthread_cleanup_{push,pop}. */
114 struct _pthread_cleanup_buffer b;
115 _pthread_cleanup_push (&b, clh, (void *) 10l);
117 fn8 ();
119 _pthread_cleanup_pop (&b, 1);