OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [c-c++-common/] [dfp/] [signbit-2.c] - Blame information for rev 700

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 686 jeremybenn
/* { dg-options "-O1" } */
2
 
3
/* Check that the compiler uses builtins for signbit; if not the link
4
   will fail because library functions are in libm.  */
5
/* See PR51867.
6
   Since GCC uses library call when optimizing for "-O0", this test
7
   case requires at least "-O1" level optimization now.  */
8
 
9
#include "dfp-dbg.h"
10
 
11
volatile _Decimal32 sd = 2.3df;
12
volatile _Decimal64 dd = -4.5dd;
13
volatile _Decimal128 tf = 5.3dl;
14
volatile float f = 1.2f;
15
volatile double d = -7.8;
16
volatile long double ld = 3.4L;
17
 
18
EXTERN int signbitf (float);
19
EXTERN int signbit (double);
20
EXTERN int signbitl (long double);
21
EXTERN int signbitd32 (_Decimal32);
22
EXTERN int signbitd64 (_Decimal64);
23
EXTERN int signbitd128 (_Decimal128);
24
 
25
int
26
main ()
27
{
28
  if (signbitf (f) != 0) FAILURE
29
  if (signbit (d) == 0) FAILURE
30
  if (signbitl (ld) != 0) FAILURE
31
  if (signbitd32 (sd) != 0) FAILURE
32
  if (signbitd64 (dd) == 0) FAILURE
33
  if (signbitd128 (tf) != 0) FAILURE
34
 
35
  FINISH
36
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.