summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/conversion.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema/conversion.c')
-rw-r--r--clang/test/Sema/conversion.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Sema/conversion.c b/clang/test/Sema/conversion.c
index 44b1224b52a..298bf756421 100644
--- a/clang/test/Sema/conversion.c
+++ b/clang/test/Sema/conversion.c
@@ -261,3 +261,13 @@ void test18() {
x = (U.a ? 0 : 1);
x = (U.b ? 0 : 1);
}
+
+// None of these should warn.
+unsigned char test19(unsigned long u64) {
+ unsigned char x1 = u64 & 0xff;
+ unsigned char x2 = u64 >> 56;
+
+ unsigned char mask = 0xee;
+ unsigned char x3 = u64 & mask;
+ return x1 + x2 + x3;
+}
OpenPOWER on IntegriCloud