1 /* { dg-do compile } */
2 /* { dg-options "-O -g -fdump-tree-backprop-details" }  */
3 
4 /* Test a simple case of non-looping code in which both uses ignore
5    the sign but only one definition is a sign op.  */
6 #define TEST_FUNCTION(TYPE, SUFFIX)				\
7   TYPE								\
8   test##SUFFIX (TYPE x, int sel1, int sel2)			\
9   {								\
10     TYPE input = sel1 ? -x : x + 1;				\
11     if (sel2)							\
12       return __builtin_cos##SUFFIX (input);			\
13     else							\
14       return __builtin_cosh##SUFFIX (input);			\
15   }
16 
17 TEST_FUNCTION (float, f)
18 TEST_FUNCTION (double, )
19 TEST_FUNCTION (long double, l)
20 
21 /* { dg-final { scan-tree-dump-times {Deleting[^\n]* = -x} 3 "backprop" } } */
22