0f2ea59df491ac4692dbe7c5c4d9c41135d50922
2 /* { dg-options "-fsanitize=signed-integer-overflow -Wno-unused-variable" } */
3 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
5 #define SCHAR_MAX __SCHAR_MAX__
6 #define SHRT_MAX __SHRT_MAX__
7 #define INT_MAX __INT_MAX__
8 #define INT_MIN (-__INT_MAX__ - 1)
10 void __attribute__((noinline
,noclone
))
20 /* Test integer promotion. */
21 #if __SCHAR_MAX__ == 127
22 volatile signed char a
= -2;
23 volatile signed char b
= SCHAR_MAX
;
24 volatile signed char c
= a
* b
;
28 #if __SHRT_MAX__ == 32767
29 volatile short d
= SHRT_MAX
;
31 volatile short f
= d
* e
;
35 #if __INT_MAX__ == 2147483647
36 volatile int m
= INT_MAX
;
38 volatile int o
= m
* n
;