demonstartes a bug in the tarval module
[libfirm] / ir / be / test / kahansum.c
index 5ef0745..d02c5a6 100644 (file)
@@ -1,3 +1,5 @@
+#include <stdio.h>
+
 float kahanSum(const float A[], int n) {
        float sum = 0.0, C = 0.0, Y, T;
        int i;
@@ -9,4 +11,12 @@ float kahanSum(const float A[], int n) {
                sum = T;
        }
        return sum;
-}
\ No newline at end of file
+}
+
+int main()
+{
+    float test[] = { 1,2,3,4,5,6,7,8,9};
+    printf("Result: %f\n", kahanSum(test, sizeof(test)/sizeof(float)));
+
+    return 0;
+}