Lines Matching full:right

35   // In shifts the type of the right operand does not affect the type of the  in shift_unsigned()
44 int no_info(int left, int right) { in no_info() argument
45 return left << right; // no-warning in no_info()
48 int all_okay(int left, int right) { in all_okay() argument
49 if (left < 0 || right < 0) in all_okay()
51 return (left << right) + (left >> right); // no-warning in all_okay()
57 int signed_arithmetic_good(int left, int right) { in signed_arithmetic_good() argument
58 if (right >= 32) in signed_arithmetic_good()
60 return left << (right - 32); in signed_arithmetic_good()
61 // expected-warning@-1 {{Right operand is negative in left shift}} in signed_arithmetic_good()
64 int signed_arithmetic_bad(int left, int right) { in signed_arithmetic_bad() argument
66 // a valid code path, so in this case it will think that that (right + 32) is in signed_arithmetic_bad()
69 // will first rule out the case when (right + 32) is larger than 32 and then in signed_arithmetic_bad()
72 if (right < 0) in signed_arithmetic_bad()
74 return left << (right + 32); in signed_arithmetic_bad()
75 // expected-warning@-1 {{Right operand is negative in left shift}} in signed_arithmetic_bad()
84 b = a << b; // expected-warning {{Right operand is negative in left shift}} in basic_examples()
86 b = a >> b; // expected-warning {{Right shift overflows the capacity of 'int'}} in basic_examples()
92 return a >> b; // pedantic-warning {{Left operand is negative in right shift}} in pedantic_examples()
111 // Ensure that we do not crash when the right operand doesn't fit in 64 bits. in large_right()