view gcc/testsuite/gcc.dg/tree-ssa/backprop-3.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-O -g -fdump-tree-backprop-details" }  */

/* Test a simple case of non-looping code in which one use ignores
   the sign but another doesn't.  */
#define TEST_FUNCTION(TYPE, SUFFIX)				\
  TYPE								\
  test##SUFFIX (TYPE x, int sel1, int sel2)			\
  {								\
    TYPE input = sel1 ? -x : __builtin_fabs##SUFFIX (x);	\
    if (sel2)							\
      return __builtin_cos##SUFFIX (input);			\
    else							\
      return __builtin_sin##SUFFIX (input);			\
  }

TEST_FUNCTION (float, f)
TEST_FUNCTION (double, )
TEST_FUNCTION (long double, l)

/* { dg-final { scan-tree-dump-times {Deleting[^\n]* = -x} 0 "backprop" } } */