xref: /illumos-gate/usr/src/tools/smatch/src/validation/overflow.c (revision f52943a93040563107b95bccb9db87d9971ef47d)
1 extern int a;
2 
3 int a = __INT_MAX__ * 2;
4 
5 int foo(void)
6 {
7 	return __INT_MAX__ * 2;
8 }
9 
10 /*
11  * check-name: overflow
12  * check-command: sparse -Wno-decl $file
13  *
14  * check-known-to-fail
15  * check-error-start
16 bug-overflow.c:3:21: warning: integer overflow in expression
17 bug-overflow.c:7:28: warning: integer overflow in expression
18  * check-error-end
19  */
20