1 /* { dg-do run } */ 2 /* { dg-options "-O2 -fsplit-loops -fdump-tree-lsplit-details" } */ 3 /* { dg-require-effective-target int32plus } */ 4 5 #ifdef __cplusplus 6 extern "C" void abort (void); 7 #else 8 extern void abort (void); 9 #endif 10 11 typedef struct { 12 int n; 13 } region_t; 14 15 void set (region_t *region) __attribute__((noinline)); 16 void doit (region_t *beg, region_t *end, region_t *limit) 17 __attribute__((noinline)); 18 19 region_t regions[10]; 20 21 void set(region_t * region)22set (region_t *region) { 23 region->n = 1; 24 } 25 26 void doit(region_t * beg,region_t * end,region_t * limit)27doit (region_t *beg, region_t *end, region_t *limit) { 28 for (region_t *cur = beg; cur < end; cur++) { 29 if (cur < limit) { 30 set(cur); 31 } 32 } 33 } 34 35 int main(void)36main (void) { 37 doit(®ions[0], ®ions[2], ®ions[10]); 38 if (regions[1].n != 1) 39 abort(); 40 } 41