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

Method output_volatile_fprintf

src/Variable.cpp:1083–1117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1081}
1082
1083int
1084Variable::output_volatile_fprintf(ostream &out, int indent, const string &name,
1085 const string &sizeof_string, const string &fp_string) const
1086{
1087 std::string sz_symbol;
1088 std::string mach = CGOptions::vol_tests_mach();
1089 std::string pointer_str;
1090
1091 if (is_pointer())
1092 pointer_str = "pointer";
1093 else
1094 pointer_str = "non-pointer";
1095
1096 if (!mach.compare("x86")) {
1097 sz_symbol = "d";
1098 }
1099 else if (!mach.compare("x86_64")) {
1100 sz_symbol = "ld";
1101 }
1102 else {
1103 assert("invalid mach!" && 0);
1104 }
1105
1106 std::string str = "fprintf(" + fp_string + ", \"" + name + "; %p; %" + sz_symbol + "; " + pointer_str + "\\n\", ";
1107 str += name;
1108 str += ", ";
1109
1110 str += sizeof_string;
1111 str += ");";
1112 output_tab(out, indent);
1113 out << str;
1114 outputln(out);
1115
1116 return 0;
1117}
1118
1119bool
1120Variable::is_seen_name(vector<std::string> &seen_names, const std::string &name) const

Callers

nothing calls this directly

Calls 2

output_tabFunction · 0.85
outputlnFunction · 0.85

Tested by

no test coverage detected