some more code I played around with lately
authorMatthias Braun <matze@braunis.de>
Mon, 22 Oct 2007 12:24:28 +0000 (12:24 +0000)
committerMatthias Braun <matze@braunis.de>
Mon, 22 Oct 2007 12:24:28 +0000 (12:24 +0000)
[r16303]

ir/be/test/codegen/intfloatconv.c [new file with mode: 0644]
ir/be/test/codegen/loadstore.c [new file with mode: 0644]

diff --git a/ir/be/test/codegen/intfloatconv.c b/ir/be/test/codegen/intfloatconv.c
new file mode 100644 (file)
index 0000000..7b56186
--- /dev/null
@@ -0,0 +1,22 @@
+
+#define SIZE 10000
+int arr1[SIZE];
+int arr2[SIZE];
+
+int main(int argc, char **argv)
+{
+       int i;
+       int iter;
+       int iterations = 100;
+
+       if(argc > 1)
+               iterations = atoi(argv[1]);
+
+       for(iter = 0; iter < iterations; ++iter) {
+               for(i = 0; i < SIZE; ++i) {
+                       arr1[i] = arr2[i] + 23.5;
+               }
+       }
+
+       return 0;
+}
diff --git a/ir/be/test/codegen/loadstore.c b/ir/be/test/codegen/loadstore.c
new file mode 100644 (file)
index 0000000..1a32204
--- /dev/null
@@ -0,0 +1,25 @@
+#include <stdio.h>
+
+static char *block;
+
+int processblock(void)
+{
+       int i;
+       block[0] = 10;
+       for(i = 0; i < 100; ++i) {
+               block[i] += 5;
+       }
+
+       return 0;
+}
+
+/* just here so the block variable doesn't get optimized away... */
+void initblock(void)
+{
+       block = malloc(100);
+}
+
+char* getme(void)
+{
+       return block;
+}