1 /* { dg-do run { target { powerpc*-*-* } } } */
2 /* { dg-options "-O2 -std=c99" } */
3 
4 #ifdef DEBUG
5 #include <stdio.h>
6 #endif
7 
8 void abort (void);
9 
main()10 int main ()
11 {
12 
13   register double  f14;
14   union blah {
15     double d;
16     unsigned long long ll;
17   } mffs_val, mffsl_val;
18 
19   /* Test reading the FPSCR register.  */
20   __asm __volatile ("mffs %0" : "=f"(f14));
21   mffs_val.d = f14;
22   /* Select the same bits as mffsl.  */
23   mffs_val.ll &= 0x70007f0ffLL;
24 
25   mffsl_val.d = __builtin_mffsl ();
26 
27   if (mffs_val.ll != mffsl_val.ll)
28     {
29 #ifdef DEBUG
30       printf("ERROR, __builtin_mffsl() returned 0x%llx, not the expecected value 0x%llx\n",
31 	     mffsl_val.ll, mffs_val.ll);
32 #else
33       abort();
34 #endif
35     }
36 }
37