Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / c-c++-common / pr58346-3.c
blob41627ed953c790acbdb89c80cfa4b9f628f18d8c
1 /* PR c/58346 */
2 /* { dg-do compile } */
4 void
5 foo (void)
7 __PTRDIFF_TYPE__ d;
8 const int i = 0;
9 int a1[2][0], a2[2][0];
10 int b1[3][i], b2[4][i];
11 d = a1 - a2; /* { dg-error "arithmetic on pointer to an empty aggregate" } */
12 __asm volatile ("" : "+g" (d));
13 /* No error here for C. */
14 d = b1 - b2; /* { dg-error "arithmetic on pointer to an empty aggregate" "" { target c++ } } */
15 __asm volatile ("" : "+g" (d));