fehler71
authorMatthias Braun <matze@braunis.de>
Tue, 14 Aug 2007 20:07:45 +0000 (20:07 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 14 Aug 2007 20:07:45 +0000 (20:07 +0000)
[r15546]

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

diff --git a/ir/be/test/fehler71.c b/ir/be/test/fehler71.c
new file mode 100644 (file)
index 0000000..f4f8f00
--- /dev/null
@@ -0,0 +1,27 @@
+/*$ -fno-if-conv $*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int a = 42;
+
+void changea(void) {
+       a = 13;
+}
+
+int f(int f) {
+       int t = a;
+       changea();
+
+       /* must not use source address mode (loading from a) for t+1 and t+2 */
+       if(f > 10000) {
+               return t + 1;
+       }
+       return f + 2;
+}
+
+int main(void) {
+       srand(0);
+       printf("Res: %d\n", f(rand()));
+       return 0;
+}