#include "../lib.h"

extern "C" {
void __pragma_loopbound(unsigned, unsigned) {}

void countnegative_init(void);
void countnegative_main(void);
int countnegative_return(void);

EXPORT("wasm_module") int wasm_module(void) {
  countnegative_init();

  fail_start_trace();
  countnegative_main();
  fail_stop_trace();

  int ret = countnegative_return();
  if (ret == 0) {
    PRINT("result correct.\n");
    fail_marker_positive();
  } else {
    PRINT("result incorrect.\n");
    fail_marker_negative();
  }
  return ret;
}
}
