1 /* Check __ppc_get_timebase() for architecture changes
2 Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. */
19 /* Test if __ppc_get_timebase() is compatible with the current processor and if
20 it's changing between reads. A read failure might indicate a Power ISA or
26 #include <sys/platform/ppc.h>
32 t1 = __ppc_get_timebase ();
33 printf ("Time Base = %"PRIu64"\n", t1);
34 t2 = __ppc_get_timebase ();
35 printf ("Time Base = %"PRIu64"\n", t2);
36 t3 = __ppc_get_timebase ();
37 printf ("Time Base = %"PRIu64"\n", t3);
38 if (t1 != t2 && t1 != t3 && t2 != t3)
41 printf ("Fail: timebase reads should always be different.");
45 #define TEST_FUNCTION do_test ()
46 #include "../test-skeleton.c"