gcc/testsuite/c-c++-common/ubsan/pr80932.c
raw| 1 | /* PR sanitizer/80932 */ |
| 2 | /* { dg-do run } */ |
| 3 | /* { dg-options "-fsanitize=undefined -fno-sanitize-trap=all -fsanitize-trap=shift,undefined" } */ |
| 4 | |
| 5 | int x = 1; |
| 6 | |
| 7 | int |
| 8 | foo (void) |
| 9 | { |
| 10 | return ((int) (2855545792U * x) - (int) (3269399503U * x)) * -5; |
| 11 | } |
| 12 | |
| 13 | int |
| 14 | main () |
| 15 | { |
| 16 | foo (); |
| 17 | } |