[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / pr81281.C
bloba812924fa18f2f6acf0827381b41fa87ba564f44
1 // PR sanitizer/81281
2 // { dg-do run }
3 // { dg-options "-fsanitize=undefined -fno-sanitize-recover=undefined" }
4 // { dg-additional-sources "pr81281-aux.cc" }
6 extern const int ci;
7 extern int i;
8 extern long long ll;
10 int
11 foo ()
13   int a = (int) (-2024172551 - i - (ci - ll))
14           - ((int) (-2024172551 - i - (ci - ll))
15              - (int) (-2024172551 - (long long)ci));
16   return a;
19 int
20 main ()
22   if (__SIZEOF_INT__ * __CHAR_BIT__ == 32
23       && __SIZEOF_LONG_LONG__ * __CHAR_BIT__ == 64)
24     foo ();
25   return 0;