Sha256: 64aac35e9a6934d06de929f81bd4aaf5f5a8e5dddb61b9bae59db8590c5c1b0d

Contents?: true

Size: 948 Bytes

Versions: 5

Compression:

Stored size: 948 Bytes

Contents


#include <stdlib.h>
#include "Relooper.h"

int main() {
  #define SIZE (10*1024*1024)
  char *buffer = (char*)malloc(SIZE);
  Relooper::SetOutputBuffer(buffer, SIZE);

  Block *b0 = new Block("print('entry'); var label; var state; var decisions = [4, 1, 4, 3, 4, 1, 2, 5, 1, 3, 5, 5, 1, 5, 2, 4, 4, 3]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }", "the_var");
  Block *b1 = new Block("print(1); state = check();", "the_var");
  Block *b2 = new Block("print(2); state = check();", "the_var");
  Block *b3 = new Block("print(3); state = check();", "the_var");
  b0->AddBranchTo(b1, "state == 1");
  b0->AddBranchTo(b3, NULL);
  b1->AddBranchTo(b1, NULL);
  b2->AddBranchTo(b3, NULL);
  b3->AddBranchTo(b2, NULL);

  Relooper r;
  r.AddBlock(b0);
  r.AddBlock(b1);
  r.AddBlock(b2);
  r.AddBlock(b3);

  r.Calculate(b0);
  printf("\n\n");
  r.Render();

  puts(buffer);

  return 1;
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
webruby-0.2.7 modules/emscripten/src/relooper/test_fuzz2.cpp
webruby-0.2.5 modules/emscripten/src/relooper/test_fuzz2.cpp
webruby-0.2.4 modules/emscripten/src/relooper/test_fuzz2.cpp
webruby-0.2.2 modules/emscripten/src/relooper/test_fuzz2.cpp
webruby-0.2.1 modules/emscripten/src/relooper/test_fuzz2.cpp