1 /* { dg-do compile { target { ! logical_op_short_circuit  } } } */
2 /* { dg-options "-O2 -fdump-tree-dom2-details -w" } */
3 
4 enum optab_methods
5 {
6   OPTAB_DIRECT,
7   OPTAB_LIB,
8   OPTAB_WIDEN,
9   OPTAB_LIB_WIDEN,
10   OPTAB_MUST_WIDEN
11 };
12 struct optab_d { };
13 typedef struct optab_d *optab;
14 void
expand_shift_1(int code,int unsignedp,int rotate,optab lshift_optab,optab rshift_arith_optab)15 expand_shift_1 (int code, int unsignedp, int rotate,
16 		optab lshift_optab, optab rshift_arith_optab)
17 {
18   int left = (code == 42 || code == 0xde);
19   int attempt;
20   enum optab_methods methods;
21   if (attempt == 0)
22     methods = OPTAB_DIRECT;
23   else if (attempt == 1)
24     methods = OPTAB_WIDEN;
25   if ((!unsignedp || (!left && methods == OPTAB_WIDEN)))
26     {
27       enum optab_methods methods1 = methods;
28       if (unsignedp)
29 	methods1 = OPTAB_MUST_WIDEN;
30       expand_binop (left ? lshift_optab : rshift_arith_optab,
31 			   unsignedp, methods1);
32     }
33 }
34 
35 /* When UNSIGNEDP is true, LEFT is false and METHOD == OPTAB_WIDEN
36    we will enter the TRUE arm of the conditional and we can thread
37    the test to compute the first first argument of the expand_binop
38    call if we look backwards through the boolean logicals.  */
39 /* { dg-final { scan-tree-dump-times "Threaded" 1 "dom2"} } */
40 
41