aboutsummaryrefslogtreecommitdiff
path: root/tests/sysy_lvX/032_if3.sy
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sysy_lvX/032_if3.sy')
-rw-r--r--tests/sysy_lvX/032_if3.sy16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/sysy_lvX/032_if3.sy b/tests/sysy_lvX/032_if3.sy
new file mode 100644
index 0000000..b810290
--- /dev/null
+++ b/tests/sysy_lvX/032_if3.sy
@@ -0,0 +1,16 @@
+// test if-else
+int ifElse() {
+ int a;
+ a = 5;
+ if (a == 5) {
+ a = 25;
+ } else {
+ a = a * 2;
+ }
+ return a;
+}
+
+
+int main() {
+ return ifElse();
+}