aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-06-30 18:30:50 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-06-30 18:30:50 -0700
commit7d8e65edda5d330787c35a3d9f9aef3ba660d2c2 (patch)
tree4f01c7ab8de35a28bb2598cbc43a64c0acec4d81 /tests/runner.py
parenta326e6a1ec7c124dd4e74a38d3c8948b3ace92bc (diff)
refactoring+cleanup, to add type info where it was missing. allows proper function indexing by type, and not recognizing the identifier. fixes issue 38
Diffstat (limited to 'tests/runner.py')
-rw-r--r--tests/runner.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 4b433b13..fdf15d44 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -1924,14 +1924,24 @@ if 'benchmark' not in sys.argv:
output_nicerizer=lambda x: x.replace('\n', '*'))
def test_dlfcn_data_and_fptr(self):
+ global LLVM_OPTS
+ if LLVM_OPTS: return self.skip() # LLVM opts will optimize out parent_func
+
global BUILD_AS_SHARED_LIB, EXPORTED_FUNCTIONS, EXPORTED_GLOBALS
lib_src = '''
#include <stdio.h>
int global = 42;
+ extern void parent_func(); // a function that is defined in the parent
+
void lib_fptr() {
printf("Second calling lib_fptr from main.\\n");
+ parent_func();
+ // call it also through a pointer, to check indexizing
+ void (*p_f)();
+ p_f = parent_func;
+ p_f();
}
void (*func(int x, void(*fptr)()))() {
@@ -1956,6 +1966,10 @@ if 'benchmark' not in sys.argv:
FUNCTYPE func;
+ void parent_func() {
+ printf("parent_func called from child\\n");
+ }
+
void main_fptr() {
printf("First calling main_fptr from lib.\\n");
}
@@ -1997,7 +2011,7 @@ if 'benchmark' not in sys.argv:
BUILD_AS_SHARED_LIB = 0
EXPORTED_FUNCTIONS = ['_main']
EXPORTED_GLOBALS = []
- self.do_test(src, 'In func: 13*First calling main_fptr from lib.*Second calling lib_fptr from main.*Var: 42*',
+ self.do_test(src, 'In func: 13*First calling main_fptr from lib.*Second calling lib_fptr from main.*parent_func called from child*parent_func called from child*Var: 42*',
output_nicerizer=lambda x: x.replace('\n', '*'))
def test_strtod(self):