[hackers] [scc] Add basic test for integer constant folding || Roberto E. Vargas Caballero
commit bf7236ddf91b0242a3960fb3f66391e1a51b4a74
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Sep 2 17:20:41 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Sep 2 18:24:03 2015 +0200
Add basic test for integer constant folding
diff --git a/cc1/tests/test019.c b/cc1/tests/test019.c
new file mode 100644
index 0000000..e9fe384
--- /dev/null
+++ b/cc1/tests/test019.c
_AT_@ -0,0 +1,61 @@
+
+/*
+name: TEST019
+description: Basic test of constant folding in integer arithmetic operations
+output:
+test019.c:13: warning: division by 0
+test019.c:14: warning: division by 0
+F1
+G1 F1 main
+{
+-
+A2 I i
+ A2 #I3 :I
+ A2 #I1 :I
+ A2 #I12 :I
+ A2 #I2 :I
+ A2 #I0 :I
+ A2 A2 #I0 %I :I
+ A2 A2 #I0 %I :I
+ A2 #I8 :I
+ A2 #I2 :I
+ A2 #I4 :I
+ A2 #IC :I
+ A2 #I8 :I
+ A2 #IFFFFFFFD :I
+ A2 #IFFFFFFF3 :I
+ A2 #I1 :I
+ A2 #I0 :I
+ A2 #I0 :I
+ A2 #I1 :I
+ A2 #I0 :I
+}
+*/
+
+#line 1
+
+int
+main(void)
+{
+ int i;
+
+ i = 1 + 2;
+ i = 2 - 1;
+ i = 3 * 6;
+ i = 10 / 5;
+ i = 10 % 5;
+ i = i % 0;
+ i = i % 0;
+ i = 1 << 3;
+ i = 8 >> 2;
+ i = 12 & 4;
+ i = 8 | 4;
+ i = 12 ^ 4;
+ i = -(3);
+ i = ~12;
+ i = 1 < 3;
+ i = 2 > 3;
+ i = 2 >= 3;
+ i = 2 <= 3;
+ i = 1 == 0;
+}
Received on Wed Sep 02 2015 - 18:25:57 CEST
This archive was generated by hypermail 2.3.0
: Wed Sep 02 2015 - 18:36:16 CEST