return&x;// expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}}
}
int*f2(inty){
return&y;// expected-warning{{Address of stack memory associated with local variable 'y' returned.}} expected-warning{{address of stack memory associated with local variable 'y' returned}}
}
int*f3(intx,int*y){
intw=0;
if(x)
y=&w;
returny;// expected-warning{{Address of stack memory associated with local variable 'w' returned.}}
}
void*compound_literal(intx,inty){
if(x)
return&(unsignedshort){((unsignedshort)0x22EF)};// expected-warning{{Address of stack memory}}
int*array[]={};
structs{intz;doubley;intw;};
if(y)
return&((structs){2,0.4,5*8});// expected-warning{{Address of stack memory}}
void*p=&((structs){42,0.4,x?42:0});
returnp;// expected-warning{{Address of stack memory}}
}
void*alloca_test(){
void*p=__builtin_alloca(10);
returnp;// expected-warning{{Address of stack memory}}