gcc/testsuite/c-c++-common/ubsan/bounds-15.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-fsanitize=bounds" } */ |
| 3 | /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */ |
| 4 | |
| 5 | int main() |
| 6 | { |
| 7 | long long offset = 10; |
| 8 | char array[10]; |
| 9 | char c = array[offset]; |
| 10 | return 0; |
| 11 | } |
| 12 | |
| 13 | /* { dg-output "index 10 out of bounds for type 'char \\\[10\\\]'" } */ |