Blame nptl/tst-audit-threads.h

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