This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
compilation/flap/tests/06-Retrolix_to_x86-64/28-switch.retrolix
Adrien Guatto 26259aa774 Publication du jalon 6
Le jalon 5 a été sauté.
2023-12-13 19:42:00 +01:00

35 lines
No EOL
688 B
Text

external printf
def check ()
c01: switch %rdi -> c02, c04, c06, c06 orelse c08;
c02: %rdi <- copy "rdi = 0\n";
c03: jump c10;
c04: %rdi <- copy "rdi = 1\n";
c05: jump c10;
c06: %rdi <- copy "rdi = 2 or 3\n";
c07: jump c10;
c08: %rdi <- copy "rdi <> 0, 1, 2, 3\n";
c09: jump c10;
c10: %rax <- copy 0;
c11: printf ();
c12: ret;
end
globals (x)
l00: %rdi <- copy 0;
l01: check ();
l02: %rdi <- copy 1;
l03: check ();
l04: %rdi <- copy 2;
l05: check ();
l06: %rdi <- copy 3;
l07: check ();
l08: %rdi <- copy 4;
l09: check ();
l10: %rdi <- copy 5;
l11: check ();
l12: %rdi <- copy 73;
l13: check ();
l14: %rdi <- copy 0;
l15: exit;
end