1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o /dev/null 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambuc /* GCC Used to generate code that contained a branch to the entry node of 4*f4a2713aSLionel Sambuc * the do_merge function. This is illegal LLVM code. To fix this, GCC now 5*f4a2713aSLionel Sambuc * inserts an entry node regardless of whether or not it has to insert allocas. 6*f4a2713aSLionel Sambuc */ 7*f4a2713aSLionel Sambuc 8*f4a2713aSLionel Sambuc struct edge_rec 9*f4a2713aSLionel Sambuc { 10*f4a2713aSLionel Sambuc struct VERTEX *v; 11*f4a2713aSLionel Sambuc struct edge_rec *next; 12*f4a2713aSLionel Sambuc int wasseen; 13*f4a2713aSLionel Sambuc int more_data; 14*f4a2713aSLionel Sambuc }; 15*f4a2713aSLionel Sambuc 16*f4a2713aSLionel Sambuc typedef struct edge_rec *QUAD_EDGE; 17*f4a2713aSLionel Sambuc 18*f4a2713aSLionel Sambuc typedef struct { 19*f4a2713aSLionel Sambuc QUAD_EDGE left, right; 20*f4a2713aSLionel Sambuc } EDGE_PAIR; 21*f4a2713aSLionel Sambuc 22*f4a2713aSLionel Sambuc struct EDGE_STACK { 23*f4a2713aSLionel Sambuc int ptr; 24*f4a2713aSLionel Sambuc QUAD_EDGE *elts; 25*f4a2713aSLionel Sambuc int stack_size; 26*f4a2713aSLionel Sambuc }; 27*f4a2713aSLionel Sambuc do_merge(QUAD_EDGE ldo,QUAD_EDGE rdo)28*f4a2713aSLionel Sambucint do_merge(QUAD_EDGE ldo, QUAD_EDGE rdo) { 29*f4a2713aSLionel Sambuc int lvalid; 30*f4a2713aSLionel Sambuc QUAD_EDGE basel,rcand; 31*f4a2713aSLionel Sambuc while (1) { 32*f4a2713aSLionel Sambuc if (!lvalid) { 33*f4a2713aSLionel Sambuc return (int)basel->next; 34*f4a2713aSLionel Sambuc } 35*f4a2713aSLionel Sambuc } 36*f4a2713aSLionel Sambuc } 37*f4a2713aSLionel Sambuc 38