================
@@ -195,3 +195,59 @@ unsigned invalid_popcount_bitset(unsigned x, signed y) {
};
}
+
+/*
+ * rotate patterns
+ */
+unsigned char rotate_left_pattern(unsigned char x) {
+ // CHECK-MESSAGES: :[[@LINE+2]]:10: warning: use 'std::rotl' instead
[modernize-use-std-bit]
+ // CHECK-FIXES: return (int)std::rotl(x, 3);
+ return x << 3 | x >> 5;
----------------
localspook wrote:
Can we add tests where...
- the args are parenthesized? i.e. `(x << 3) | (x >> 5)`
- we rotate a variable wider than a byte?
https://github.com/llvm/llvm-project/pull/186324
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits