@needs_dlfcn
def test_dylink_funcpointer(self):
    self.dylink_test(main='\n      #include <stdio.h>\n      #include <assert.h>\n      #include "header.h"\n      intfunc sidey(intfunc f);\n      void a(int arg) { printf("hello from funcptr: %d\\n", arg); }\n      int main() {\n        intfunc b = sidey(a);\n        assert(a == b);\n        b(0);\n        return 0;\n      }\n      ', side='\n      #include "header.h"\n      intfunc sidey(intfunc f) { f(1); return f; }\n      ', expected='hello from funcptr: 1\nhello from funcptr: 0\n', header='typedef void (*intfunc)(int );')
@needs_dlfcn
def test_dylink_funcpointer(self):
    self.dylink_test(main='\n      #include <stdio.h>\n      #include <assert.h>\n      #include "header.h"\n      intfunc sidey(intfunc f);\n      void a(int arg) { printf("hello from funcptr: %d\\n", arg); }\n      int main() {\n        intfunc b = sidey(a);\n        assert(a == b);\n        b(0);\n        return 0;\n      }\n      ', side='\n      #include "header.h"\n      intfunc sidey(intfunc f) { f(1); return f; }\n      ', expected='hello from funcptr: 1\nhello from funcptr: 0\n', header='typedef void (*intfunc)(int );')