aboutsummaryrefslogtreecommitdiff
path: root/tests/sysy_lvX/033_if4.sy
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sysy_lvX/033_if4.sy')
-rw-r--r--tests/sysy_lvX/033_if4.sy18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/sysy_lvX/033_if4.sy b/tests/sysy_lvX/033_if4.sy
new file mode 100644
index 0000000..43ec90d
--- /dev/null
+++ b/tests/sysy_lvX/033_if4.sy
@@ -0,0 +1,18 @@
+// test if-if-else
+int ififElse() {
+ int a;
+ a = 5;
+ int b;
+ b = 10;
+ if(a == 5)
+ if (b == 10)
+ a = 25;
+ else
+ a = a + 15;
+
+ return a;
+}
+
+int main(){
+ return ififElse();
+} \ No newline at end of file