// BEGIN mycpp output #include "mycpp/runtime.h" GLOBAL_STR(str0, "greater"); GLOBAL_STR(str1, "less"); GLOBAL_STR(str2, "global string"); GLOBAL_STR(str3, "."); GLOBAL_STR(str4, "foo"); namespace test_hoist { // forward declare } // forward declare namespace test_hoist namespace test_hoist { // declare BigStr* f(BigStr* s); extern BigStr* S; void g(); BigStr* strfunc(BigStr* s); void run_tests(); void run_benchmarks(); } // declare namespace test_hoist namespace test_hoist { // define BigStr* f(BigStr* s) { int x; StackRoot _root0(&s); x = 1; if (x > 0) { s = str0; } else { s = str1; } print(s); return s; } BigStr* S = str2; void g() { print(S); } BigStr* strfunc(BigStr* s) { StackRoot _root0(&s); return str_concat(s, str3); } void run_tests() { f(str4); g(); } void run_benchmarks() { FAIL(kNotImplemented); // Python NotImplementedError } } // define namespace test_hoist