summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/pr47251.c
blob: 6cb9f492e9c610f08df8452f9a1537861ea7c56c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -msoft-float -mcpu=power7" } */

/* PR 47151: libgcc fails to build when using --with-cpu=power7 due to a missed
   TARGET_HARD_FLOAT test.  */
unsigned long long
func (float a)
{
  const float dfa = a;
  const unsigned int hi = dfa / 0x1p32f;
  const unsigned int lo = dfa - (float) hi * 0x1p32f;
  return ((unsigned long long) hi << (4 * 8)) | lo;
}