ubuntu-buildroot/output/build/host-gcc-initial-11.4.0/gcc/testsuite/gcc.target/powerpc/ppc-mftb.c

19 lines
403 B
C
Raw Permalink Normal View History

2024-04-01 15:19:46 +00:00
/* { 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;
}