aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-06-25 07:49:01 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-06-25 07:49:01 -0700
commit936ccd93b961b99817e68a9e628a2986f6c7b297 (patch)
treecfcfdd7bf397631ef81f657e646f840e86926599 /tests/runner.py
parentc9b968a4467fc1c004da69dc2f0000728fbf108e (diff)
indexize Math.* properly. fixes issue 29
Diffstat (limited to 'tests/runner.py')
-rw-r--r--tests/runner.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 59062302..4215bfea 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -1097,6 +1097,21 @@ if 'benchmark' not in sys.argv:
'''
self.do_test(src, '*26,26,90,90,26,90*\n*1,0,0,1*\n*goodbye!*')
+ def test_mathfuncptr(self):
+ src = '''
+ #include <math.h>
+ #include <stdio.h>
+
+ int
+ main(void) {
+ float (*fn)(float) = &sqrtf;
+ float (*fn2)(float) = &fabsf;
+ printf("fn2(-5) = %d, fn(10) = %f\\n", (int)fn2(-5), fn(10));
+ return 0;
+ }
+ '''
+ self.do_test(src, 'fn2(-5) = 5, fn(10) = 3.16')
+
def test_emptyclass(self):
src = '''
#include <stdio.h>