summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/sse2-rint-inline-2.c
blob: 3ebf7a7af69cbf86b37e32a2b996a784f6a49c43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Test rint and related functions expanded inline for SSE2.  rint
   should be expanded even when spurious "inexact" not allowed.  */
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -mfpmath=sse -fno-fp-int-builtin-inexact" } */
/* { dg-add-options c99_runtime } */
/* { dg-require-effective-target sse2 } */

#define TEST(FN, TYPE)				\
  do						\
    {						\
      volatile TYPE a = 1.5, b;			\
      b = FN (a);				\
    }						\
  while (0)

#define FN_TESTS(FN)					\
  do							\
    {							\
      TEST (__builtin_ ## FN, double);			\
      TEST (__builtin_ ## FN ## f, float);		\
    }							\
  while (0)

void
test (void)
{
  FN_TESTS (rint);
}

/* { dg-final { scan-assembler-not "\[ \t\]rint" } } */