ppc-get-timebase.c: New file.

2012-09-19  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>

        * gcc.target/powerpc/ppc-get-timebase.c: New file.
        * gcc.target/powerpc/ppc-mftb.c: New file.

From-SVN: r191492
This commit is contained in:
Tulio Magno Quites Machado Filho 2012-09-19 19:08:00 +00:00 committed by David Edelsohn
parent 0efbf084f4
commit 7b49d6db24
3 changed files with 43 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2012-09-19 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* gcc.target/powerpc/ppc-get-timebase.c: New file.
* gcc.target/powerpc/ppc-mftb.c: New file.
2012-09-19 Oleg Endo <olegendo@gcc.gnu.org>
PR target/54089

View File

@ -0,0 +1,20 @@
/* { dg-do run { target { powerpc*-*-* } } } */
/* Test if __builtin_ppc_get_timebase () is compatible with the current
processor and if it's changing between reads. A read failure might indicate
a Power ISA or binutils change. */
#include <inttypes.h>
int
main (void)
{
uint64_t t = __builtin_ppc_get_timebase ();
int j;
for (j = 0; j < 1000000; j++)
if (t != __builtin_ppc_get_timebase ())
return 0;
return 1;
}

View File

@ -0,0 +1,18 @@
/* { dg-do run { target { powerpc*-*-* } } } */
/* Test if __builtin_ppc_mftb () is compatible with the current processor and
if it's changing between reads. A read failure might indicate a Power
ISA or binutils change. */
int
main (void)
{
unsigned long t = __builtin_ppc_mftb ();
int j;
for (j = 0; j < 1000000; j++)
if (t != __builtin_ppc_mftb ())
return 0;
return 1;
}