gcc/testsuite/c-c++-common/ubsan/pr67921.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-fsanitize=undefined" } */ |
| 3 | |
| 4 | struct s |
| 5 | { |
| 6 | int n; |
| 7 | int arr[][6]; |
| 8 | }; |
| 9 | void bar (int); |
| 10 | void foo (struct s *ptr) |
| 11 | { |
| 12 | int i; |
| 13 | for (; i < 2; i++) |
| 14 | for (; ptr->n;) |
| 15 | { |
| 16 | int *a = ptr->arr[i]; |
| 17 | int b[66]; |
| 18 | int j = 0; |
| 19 | |
| 20 | for (; j < 56; j++) |
| 21 | bar (a[j] - b[j]); |
| 22 | } |
| 23 | } |