Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- validation/overflow.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 validation/overflow.c diff --git a/validation/overflow.c b/validation/overflow.c new file mode 100644 index 000000000..c2655e329 --- /dev/null +++ b/validation/overflow.c @@ -0,0 +1,19 @@ +extern int a; + +int a = __INT_MAX__ * 2; + +int foo(void) +{ + return __INT_MAX__ * 2; +} + +/* + * check-name: overflow + * check-command: sparse -Wno-decl $file + * + * check-known-to-fail + * check-error-start +bug-overflow.c:3:21: warning: integer overflow in expression +bug-overflow.c:7:28: warning: integer overflow in expression + * check-error-end + */ -- 2.14.0 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html