brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · e580e5a Raw
75 lines · cpp
1#include "test.h"2#include <cstdlib>3 4bool on = false;5int len = 42;6double grid[10][10] = {0};7const char * hello = "world";8const char * world = "hello";9 10void A::B() {}11 12void useless() {}13 14double more_useless() {15  return 0;16}17 18int foo() {19  on = true;20  return 3;21}22 23int bar() {24  len--;25  return foo() + 45;26}27 28void assign(int ii, int jj) {29  grid[ii][jj] = (ii+1) * (jj+1);30}31 32void initialize_grid() {33  for (int ii = 0; ii < 2; ii++)34    for (int jj = 0; jj < 2; jj++)35      assign(ii, jj);36}37 38int main() {39  initialize_grid();40 41  int a = 2;42  on = rand() % 2;43  if (on) {44    foo();45    ++a;46  } else {47    bar();48    a += rand();49  }50 51  for (int ii = 0; ii < 10; ++ii) {52    switch (rand() % 5) {53      case 0:54        a += rand();55        break;56      case 1:57      case 2:58        a += rand() / rand();59        break;60      case 3:61        a -= rand();62        break;63      default:64        a = -1;65    }66  }67 68  A thing;69  for (uint64_t ii = 0; ii < 4294967296; ++ii)70    thing.B();71 72  return a + 8 + grid[2][3] + len;73  return more_useless();74}75