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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [builtin-cproj-2.c] - Blame information for rev 754

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

Line No. Rev Author Line
1 689 jeremybenn
/* Copyright (C) 2010  Free Software Foundation.
2
 
3
   Verify that folding of built-in cproj is correctly performed by the
4
   compiler.  With -ffinite-math-only all cproj calls should be
5
   eliminated regardless of what the argument is, or what is known
6
   about it.
7
 
8
   Origin: Kaveh R. Ghazi,  April 9, 2010.  */
9
 
10
/* { dg-do link } */
11
/* { dg-options "-ffinite-math-only" } */
12
 
13
/* All references to link_error should go away at compile-time.  The
14
   argument is the __LINE__ number.  It appears in the tree dump file
15
   and aids in debugging should any of the tests fail.  */
16
extern void link_error(int);
17
 
18
#define CPROJ(X) __builtin_cproj(X)
19
#define CPROJF(X) __builtin_cprojf(X)
20
#define CPROJL(X) __builtin_cprojl(X)
21
 
22
/* Test that the supplied expressions eliminte the cproj call.  */
23
#define TEST_EXPRS(LD_EXPR, D_EXPR, F_EXPR) do { \
24
  if (CPROJF(F_EXPR) != (F_EXPR)) \
25
    link_error (__LINE__); \
26
  if (CPROJ(D_EXPR) != (D_EXPR)) \
27
    link_error (__LINE__); \
28
  if (CPROJL(LD_EXPR) != (LD_EXPR)) \
29
    link_error (__LINE__); \
30
} while (0)
31
 
32
void foo (_Complex long double cld, _Complex double cd, _Complex float cf)
33
{
34
#ifdef __OPTIMIZE__
35
  TEST_EXPRS (cld, cd, cf);
36
  TEST_EXPRS (cld*2, cd*2, cf*2);
37
  TEST_EXPRS (cld*cld, cd*cd, cf*cf);
38
#endif
39
 
40
  return;
41
}
42
 
43
int main (void)
44
{
45
  return 0;
46
}

powered by: WebSVN 2.1.0

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