aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr68317.c
blob: bd053a7522bcbc7dc0ef2ae30d48f51566b5c1ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */
/* { dg-options "-O2 -fdisable-tree-ethread" } */

/* Note: Threader will collapse loop.  */

typedef int int32_t __attribute__((mode (__SI__)));

void bar (int32_t);

void
foo ()
{
 int32_t index = 0;

 for (index; index <= 10; index--) // expected warning here
   /* Result of the following multiply will overflow
      when converted to signed int32_t.  */
   bar ((0xcafe + index) * 0xdead);  /* { dg-warning "iteration \[0-9\]+ invokes undefined behavior" } */
}