Compiler Design 2023

Testcase “short_circuit” of Assignment 5:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
bool f() {
  putString("Error: && shortcircuit evaluation not done!\n");
  return false;
}

bool ff() {
  putString("Error: || shortcircuit evaluation not done!\n");
  return false;
}

int main() {

  if (false && f()) {}

  if (true || ff()) {}

}