2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / c-c++-common / ubsan / overflow-add-4.c
blob3f6f6bd089508776dfac3a11c175e53840a8550f
1 /* { dg-do run } */
2 /* { dg-options "-fsanitize=signed-integer-overflow -Wno-unused-variable -fsanitize-undefined-trap-on-error" } */
3 /* { dg-shouldfail "ubsan" } */
5 #define INT_MAX __INT_MAX__
6 #define INT_MIN (-__INT_MAX__ - 1)
8 int
9 main (void)
11 volatile int j = INT_MAX;
12 volatile int i = 1;
13 volatile int k = j + i;
14 return 0;