From 98b744de32d38333ff887f3fdaab550c536f2bc7 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 2 Oct 2008 11:55:23 +0000 Subject: [PATCH] test for a rather simply gcc optimization [r22409] --- ir/be/test/global_null_test.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ir/be/test/global_null_test.c diff --git a/ir/be/test/global_null_test.c b/ir/be/test/global_null_test.c new file mode 100644 index 000000000..4e28c5a02 --- /dev/null +++ b/ir/be/test/global_null_test.c @@ -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); +} -- 2.20.1