Skip to content

Conversation

robertoraggi
Copy link
Owner

Enough for

int goto_loop1() {
  int i = 0;

loop:
  if (i - 10) {
    i = i + 1;
    goto loop;
  }

  return i;
}

int goto_loop2() {
  int i;
  i = 10;
  goto L;
L:
  i = i + 1;
  i = i + 2;
  return i;
}
$ cxx x.c -emit-ir | mlir-translate -mlir-to-llvmir  |lli --entry-function=goto_loop1; echo $?
10

$ cxx x.c -emit-ir | mlir-translate -mlir-to-llvmir  |lli --entry-function=goto_loop2; echo $?
13

@robertoraggi robertoraggi merged commit 3e237bd into main Aug 3, 2025
9 checks passed
@robertoraggi robertoraggi deleted the near-scallop branch August 3, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant