* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
[official-gcc.git] / gcc / testsuite / c-c++-common / ubsan / bounds-3.c
blobfcf71a3bf8a0965b437f5f2d3cf01db7952d7ff5
1 /* { dg-do compile } */
2 /* { dg-options "-fsanitize=bounds -Wall -Wextra" } */
4 /* Do not generate invalid diagnostics. */
6 extern const int a[10];
7 extern int bar (int);
8 void
9 foo (int i, int j)
11 bar (a[i] >> j);
12 bar ((unsigned long) a[i] >> j);
13 bar ((short int) (unsigned long) a[i] >> j);
14 bar (j >> a[i]);
15 bar (j >> (unsigned long) a[i]);
16 bar (j >> (short int) (unsigned long) a[i]);
17 bar (a[i] / j);
18 bar ((unsigned long) a[i] / j);
19 bar ((short int) (unsigned long) a[i] / j);
20 bar (j / a[i]);
21 bar (j / (unsigned long) a[i]);
22 bar (j / (short int) (unsigned long) a[i]);