/* Unit Test for constant folding SCCFprf_reshape */ /* take (constant, structuralConstant) */ /* RESULT: reshape 2 1 */ int[*] id(int[*] y) { return(y); } int plus(int x, int y) { return( _add_SxS_(x,y)); } int sum(int[.,.] y) { z = with { ([0,0] <= iv < _shape_A_(y)) : _sel_VxA_(iv,y); } : fold (plus, 0); return(z); } int main() { one = id(1); v = [one,one,one,one,one,one]; v1 = _reshape_VxA_([2,3],v); z = sum(v1); z = _sub_SxS_(z,6); /* 0 = success */ return(z); }