Commit 7b49d6db by Tulio Magno Quites Machado Filho Committed by David Edelsohn

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
parent 0efbf084
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
......
/* { 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;
}
/* { 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment