1 /* glibc-hwcaps subdirectory test. powerpc64le version.
2 Copyright (C) 2020-2022 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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 <https://www.gnu.org/licenses/>. */
21 #include <support/check.h>
23 #include <sys/param.h>
25 extern int marker2 (void);
26 extern int marker3 (void);
28 /* Return the POWER level, 8 for the baseline. */
32 const char *platform
= (const char *) getauxval (AT_PLATFORM
);
33 if (strcmp (platform
, "power8") == 0)
35 if (strcmp (platform
, "power9") == 0)
37 if (strcmp (platform
, "power10") == 0)
39 printf ("warning: unrecognized AT_PLATFORM value: %s\n", platform
);
40 /* Assume that the new platform supports POWER10. */
47 int level
= compute_level ();
48 printf ("info: detected POWER level: %d\n", level
);
49 TEST_COMPARE (marker2 (), MIN (level
- 7, 2));
50 TEST_COMPARE (marker3 (), MIN (level
- 7, 3));
54 #include <support/test-driver.c>