MCPcopy Create free account
hub / github.com/csmith-project/csmith / output_header

Method output_header

src/StatementArrayOp.cpp:210–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210void
211StatementArrayOp::output_header(std::ostream& out, int& indent) const
212{
213 size_t i;
214 for (i=0; i<array_var->get_dimension(); i++) {
215 if (i > 0) {
216 output_tab(out, indent);
217 out << "{";
218 outputln(out);
219 indent++;
220 }
221 output_tab(out, indent);
222 out << "for (";
223 ctrl_vars[i]->Output(out);
224 out << " = " << inits[i] << "; ";
225 ctrl_vars[i]->Output(out);
226 (incrs[i] > 0) ? out << " < " << array_var->get_sizes()[i] : out << " >= 0";
227 out << "; ";
228 ctrl_vars[i]->Output(out);
229 if (CGOptions::ccomp()) {
230 // ccomp disable something like g += 1, where g is volatile
231 out << " = ";
232 ctrl_vars[i]->Output(out);
233 out << " + " << incrs[i] << ")";
234 }
235 else {
236 out << " += " << incrs[i] << ")";
237 }
238 outputln(out);
239 }
240}
241
242/*
243 *

Callers

nothing calls this directly

Calls 5

output_tabFunction · 0.85
outputlnFunction · 0.85
get_sizesMethod · 0.80
get_dimensionMethod · 0.45
OutputMethod · 0.45

Tested by

no test coverage detected