diff options
author | Diana Picus <diana.picus@linaro.org> | 2017-06-13 12:50:06 +0000 |
---|---|---|
committer | Diana Picus <diana.picus@linaro.org> | 2017-06-13 12:50:06 +0000 |
commit | bec724cbb08ab510b30a2677c3cf0afdf77741eb (patch) | |
tree | f80d8801e80a5441c8364b474341777e36eaf4c4 /clang/test/Sema/integer-overflow.c | |
parent | ba6a10fdcc18a3ef53b2ca2644dc42abccb686b1 (diff) | |
download | llvm-bec724cbb08ab510b30a2677c3cf0afdf77741eb.zip llvm-bec724cbb08ab510b30a2677c3cf0afdf77741eb.tar.gz llvm-bec724cbb08ab510b30a2677c3cf0afdf77741eb.tar.bz2 |
Revert "Revert r301742 which made ExprConstant checking apply to all full-exprs."
This reverts commit r305239 because it broke the buildbots (the
diag-flags.cpp test is failing).
llvm-svn: 305287
Diffstat (limited to 'clang/test/Sema/integer-overflow.c')
-rw-r--r-- | clang/test/Sema/integer-overflow.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/test/Sema/integer-overflow.c b/clang/test/Sema/integer-overflow.c index 44c2629..62ee33e 100644 --- a/clang/test/Sema/integer-overflow.c +++ b/clang/test/Sema/integer-overflow.c @@ -152,7 +152,13 @@ uint64_t check_integer_overflows(int i) { uint64_t b2 = b[4608 * 1024 * 1024] + 1; // expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} - (void)((i ? (4608 * 1024 * 1024) : (4608 * 1024 * 1024)) + 1); + int j1 = i ? (4608 * 1024 * 1024) : (4608 * 1024 * 1024); + +// expected-warning@+1 {{overflow in expression; result is 536870912 with type 'int'}} + int j2 = -(4608 * 1024 * 1024); + +// expected-warning@+1 {{overflow in expression; result is 536870912 with type 'int'}} + uint64_t j3 = b[4608 * 1024 * 1024]; // expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} return ((4608 * 1024 * 1024) + ((uint64_t)(4608 * 1024 * 1024))); |