test for a rather simply gcc optimization
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 2 Oct 2008 11:55:23 +0000 (11:55 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 2 Oct 2008 11:55:23 +0000 (11:55 +0000)
[r22409]

ir/be/test/global_null_test.c [new file with mode: 0644]

diff --git a/ir/be/test/global_null_test.c b/ir/be/test/global_null_test.c
new file mode 100644 (file)
index 0000000..4e28c5a
--- /dev/null
@@ -0,0 +1,24 @@
+static void f1(void) {
+       printf("f1\n");
+}
+
+static void f2(void) {
+       printf("f2\n");
+}
+
+int test(char *x)
+{
+  char ret = *x;
+
+  if (x)
+    f1();
+  else
+    f2();
+  return ret;
+}
+
+int main(int argc, char *argv[]) {
+       char x = '\0';
+
+       return test(&x);
+}