aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2014-05-07 03:07:34 +0800
committerTeddy <ted.sybil@gmail.com>2014-05-07 03:07:34 +0800
commit0ac22f0214ee283ce9bb053d691aeac823f875be (patch)
tree46a8b37c505fc6789d6834e053322aadc2ec7e0e
parentd3cea3654c2392154cee027903d126f41b679c87 (diff)
add opt checking testcases
-rw-r--r--testbed/custom_const.c (renamed from testbed/custom_opt.c)0
-rw-r--r--testbed/custom_subexp.c9
-rw-r--r--testbed/custom_subexp2.c10
3 files changed, 19 insertions, 0 deletions
diff --git a/testbed/custom_opt.c b/testbed/custom_const.c
index d0126f3..d0126f3 100644
--- a/testbed/custom_opt.c
+++ b/testbed/custom_const.c
diff --git a/testbed/custom_subexp.c b/testbed/custom_subexp.c
new file mode 100644
index 0000000..bce5bdb
--- /dev/null
+++ b/testbed/custom_subexp.c
@@ -0,0 +1,9 @@
+int N = 0;
+void f() { N = 2; }
+int main() {
+ int a, b;
+ a = N + 1;
+ f();
+ b = N + 1;
+ printf("%d\n", b);
+}
diff --git a/testbed/custom_subexp2.c b/testbed/custom_subexp2.c
new file mode 100644
index 0000000..1e4af93
--- /dev/null
+++ b/testbed/custom_subexp2.c
@@ -0,0 +1,10 @@
+int flag = 0;
+int check(int x, int y) {
+ return x > 0 && y > 0 && (flag ^= 1);
+}
+int main() {
+ int x = 1, y = 2;
+ printf("%d\n", check(x, y));
+ printf("%d\n", check(x, y));
+ printf("%d\n", check(x, y));
+}