[hackers] [scc] Add test of IF statement || Roberto E. Vargas Caballero
commit 5bb717efd8b6fab5fa7bc324dce6b0a8e4261f86
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Aug 14 23:22:14 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Aug 14 23:22:14 2015 +0200
Add test of IF statement
diff --git a/cc1/tests/test006.c b/cc1/tests/test006.c
new file mode 100644
index 0000000..4f67fbb
--- /dev/null
+++ b/cc1/tests/test006.c
_AT_@ -0,0 +1,55 @@
+/*
+name: TEST006
+description: Basic test for if
+output:
+G1 M c
+F1
+X2 F1 main
+G2 F1 main {
+-
+ j L2 #I0 #I0 =I
+ yI #I1
+ j L3
+L2
+ j L4 #I0 #I0 =I
+ j L5
+L4
+ j L6 #I1 #I0 =I
+ j L7 G1 MI #I0 =I
+ yI #I1
+ j L8
+L7
+ yI #I0
+L8
+ j L9
+L6
+ yI #I1
+L9
+L5
+L3
+ yI #I1
+}
+*/
+
+char c;
+
+int
+main()
+{
+ if(0) {
+ return 1;
+ } else if(0) {
+ /* empty */
+ } else {
+ if(1) {
+ if(c)
+ return 1;
+ else
+ return 0;
+ } else {
+ return 1;
+ }
+ }
+ return 1;
+}
+
Received on Fri Aug 14 2015 - 23:22:50 CEST
This archive was generated by hypermail 2.3.0
: Fri Aug 14 2015 - 23:24:17 CEST