1 2/* { dg-do compile } */ 3/* { dg-options "-O2 -fdump-tree-isolate-paths" } */ 4/* { dg-skip-if "" keeps_null_pointer_checks } */ 5 6 7struct demangle_component 8{ 9 10 int type; 11 int zzz; 12 13}; 14 15 16struct d_info 17{ 18 struct demangle_component *comps; 19 int next_comp; 20 int num_comps; 21}; 22 23 24static struct demangle_component * 25d_make_empty (struct d_info *di) 26{ 27 struct demangle_component *p; 28 29 if (di->next_comp >= di->num_comps) 30 return ((void *)0); 31 p = &di->comps[di->next_comp]; 32 return p; 33} 34 35 36 37struct demangle_component * 38d_type (struct d_info *di) 39{ 40 struct demangle_component *ret; 41 ret = d_make_empty (di); 42 ret->type = 42; 43 ret->zzz = -1; 44 return ret; 45} 46 47/* We're testing three aspects of isolation here. First that isolation 48 occurs, second that if we have two null dereferences in a block that 49 that we delete everything from the first dereferece to the end of the 50 block, regardless of which comes first in the immediate use iterator 51 and finally that we set the RHS of the store to zero. */ 52/* { dg-final { scan-tree-dump-times "__builtin_trap" 1 "isolate-paths"} } */ 53/* { dg-final { scan-tree-dump-times "->type = 42" 1 "isolate-paths"} } */ 54/* { dg-final { scan-tree-dump-times "->type ={v} 0" 1 "isolate-paths"} } */ 55/* { dg-final { scan-tree-dump-times "->zzz" 1 "isolate-paths"} } */ 56/* { dg-final { cleanup-tree-dump "isolate-paths" } } */ 57 58 59 60 61 62