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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [builtin-convert-4.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Copyright (C) 2007  Free Software Foundation.
2
 
3
   Verify that nearbyint isn't transformed into e.g. rint or lrint
4
   when -ftrapping-math is set.
5
 
6
   Written by Kaveh ghazi, 2007-03-04.  */
7
 
8
/* { dg-do compile } */
9
/* { dg-options "-ftrapping-math -fdump-tree-original" } */
10
/* { dg-options "-ftrapping-math -fdump-tree-original -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
11
/* { dg-options "-ftrapping-math -fdump-tree-original -std=c99" { target *-*-solaris2* } } */
12
 
13
#include "../builtins-config.h"
14
 
15
extern void bar (long);
16
 
17
#define TESTIT(FUNC) do { \
18
  bar (__builtin_##FUNC(d)); \
19
  bar (__builtin_##FUNC##f(f)); \
20
  bar (__builtin_##FUNC##l(ld)); \
21
} while (0)
22
 
23
void __attribute__ ((__noinline__)) foo (double d, float f, long double ld)
24
{
25
  TESTIT(nearbyint);
26
}
27
 
28
int main()
29
{
30
  foo (1.0, 2.0, 3.0);
31
  return 0;
32
}
33
 
34
/* { dg-final { scan-tree-dump-times "nearbyint " 1 "original" } } */
35
/* { dg-final { scan-tree-dump-times "nearbyintf" 1 "original" } } */
36
/* { dg-final { scan-tree-dump-times "nearbyintl" 1 "original" } } */
37
/* { dg-final { cleanup-tree-dump "original" } } */

powered by: WebSVN 2.1.0

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