Blame nptl/tst-audit-threads.h

Packit Service f2f644
/* Helper header for test-audit-threads.
Packit Service f2f644
Packit Service f2f644
   Copyright (C) 2018 Free Software Foundation, Inc.
Packit Service f2f644
   This file is part of the GNU C Library.
Packit Service f2f644
Packit Service f2f644
   The GNU C Library is free software; you can redistribute it and/or
Packit Service f2f644
   modify it under the terms of the GNU Lesser General Public
Packit Service f2f644
   License as published by the Free Software Foundation; either
Packit Service f2f644
   version 2.1 of the License, or (at your option) any later version.
Packit Service f2f644
Packit Service f2f644
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service f2f644
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service f2f644
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service f2f644
   Lesser General Public License for more details.
Packit Service f2f644
Packit Service f2f644
   You should have received a copy of the GNU Lesser General Public
Packit Service f2f644
   License along with the GNU C Library; if not, see
Packit Service f2f644
   <http://www.gnu.org/licenses/>.  */
Packit Service f2f644
Packit Service f2f644
/* We use this helper to create a large number of functions, all of
Packit Service f2f644
   which will be resolved lazily and thus have their PLT updated.
Packit Service f2f644
   This is done to provide enough functions that we can statistically
Packit Service f2f644
   observe a thread vs. PLT resolution failure if one exists.  */
Packit Service f2f644
Packit Service f2f644
#define CONCAT(a, b) a ## b
Packit Service f2f644
#define NUM(x, y) CONCAT (x, y)
Packit Service f2f644
Packit Service f2f644
#define FUNC10(x)	\
Packit Service f2f644
  FUNC (NUM (x, 0));	\
Packit Service f2f644
  FUNC (NUM (x, 1));	\
Packit Service f2f644
  FUNC (NUM (x, 2));	\
Packit Service f2f644
  FUNC (NUM (x, 3));	\
Packit Service f2f644
  FUNC (NUM (x, 4));	\
Packit Service f2f644
  FUNC (NUM (x, 5));	\
Packit Service f2f644
  FUNC (NUM (x, 6));	\
Packit Service f2f644
  FUNC (NUM (x, 7));	\
Packit Service f2f644
  FUNC (NUM (x, 8));	\
Packit Service f2f644
  FUNC (NUM (x, 9))
Packit Service f2f644
Packit Service f2f644
#define FUNC100(x)	\
Packit Service f2f644
  FUNC10 (NUM (x, 0));	\
Packit Service f2f644
  FUNC10 (NUM (x, 1));	\
Packit Service f2f644
  FUNC10 (NUM (x, 2));	\
Packit Service f2f644
  FUNC10 (NUM (x, 3));	\
Packit Service f2f644
  FUNC10 (NUM (x, 4));	\
Packit Service f2f644
  FUNC10 (NUM (x, 5));	\
Packit Service f2f644
  FUNC10 (NUM (x, 6));	\
Packit Service f2f644
  FUNC10 (NUM (x, 7));	\
Packit Service f2f644
  FUNC10 (NUM (x, 8));	\
Packit Service f2f644
  FUNC10 (NUM (x, 9))
Packit Service f2f644
Packit Service f2f644
#define FUNC1000(x)		\
Packit Service f2f644
  FUNC100 (NUM (x, 0));		\
Packit Service f2f644
  FUNC100 (NUM (x, 1));		\
Packit Service f2f644
  FUNC100 (NUM (x, 2));		\
Packit Service f2f644
  FUNC100 (NUM (x, 3));		\
Packit Service f2f644
  FUNC100 (NUM (x, 4));		\
Packit Service f2f644
  FUNC100 (NUM (x, 5));		\
Packit Service f2f644
  FUNC100 (NUM (x, 6));		\
Packit Service f2f644
  FUNC100 (NUM (x, 7));		\
Packit Service f2f644
  FUNC100 (NUM (x, 8));		\
Packit Service f2f644
  FUNC100 (NUM (x, 9))
Packit Service f2f644
Packit Service f2f644
#define FUNC7000()	\
Packit Service f2f644
  FUNC1000 (1);		\
Packit Service f2f644
  FUNC1000 (2);		\
Packit Service f2f644
  FUNC1000 (3);		\
Packit Service f2f644
  FUNC1000 (4);		\
Packit Service f2f644
  FUNC1000 (5);		\
Packit Service f2f644
  FUNC1000 (6);		\
Packit Service f2f644
  FUNC1000 (7);
Packit Service f2f644
Packit Service f2f644
#ifdef FUNC
Packit Service f2f644
# undef FUNC
Packit Service f2f644
#endif
Packit Service f2f644
Packit Service f2f644
#ifdef externnum
Packit Service f2f644
# define FUNC(x) extern int CONCAT (retNum, x) (void)
Packit Service f2f644
#endif
Packit Service f2f644
Packit Service f2f644
#ifdef definenum
Packit Service f2f644
# define FUNC(x) int CONCAT (retNum, x) (void) { return x; }
Packit Service f2f644
#endif
Packit Service f2f644
Packit Service f2f644
#ifdef callnum
Packit Service f2f644
# define FUNC(x) CONCAT (retNum, x) (); sync_all (x)
Packit Service f2f644
#endif
Packit Service f2f644
Packit Service f2f644
/* A value of 7000 functions is chosen as an arbitrarily large
Packit Service f2f644
   number of functions that will allow us enough attempts to
Packit Service f2f644
   verify lazy resolution operation.  */
Packit Service f2f644
FUNC7000 ();