From 9add1594d2cd5250bf6ea57bcfdb3dce676ba736 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Wed, 17 May 2017 23:56:54 +0000 Subject: The constant expression evaluator should examine function arguments for non-constexpr function calls unless the EvalInfo says to stop. llvm-svn: 303317 --- clang/test/Sema/integer-overflow.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/test/Sema/integer-overflow.c') diff --git a/clang/test/Sema/integer-overflow.c b/clang/test/Sema/integer-overflow.c index 62ee33e..c2b6ba2 100644 --- a/clang/test/Sema/integer-overflow.c +++ b/clang/test/Sema/integer-overflow.c @@ -151,6 +151,14 @@ uint64_t check_integer_overflows(int i) { uint64_t *b; uint64_t b2 = b[4608 * 1024 * 1024] + 1; +// expected-warning@+1 {{overflow in expression; result is 536870912 with type 'int'}} + f0(4608 * 1024 * 1024); + f0(4608ul * 1024 * 1024); +// expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} + f1(4608 * 1024 * 1024, 4608 * 1024 * 1024); +// expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} + f2(4608 * 1024 * 1024, 4608 * 1024 * 1024); + // expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} int j1 = i ? (4608 * 1024 * 1024) : (4608 * 1024 * 1024); -- cgit v1.1