From 19f4f86bfed21c5326ed2acebe1163f3a83e832b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 04:25:50 +0200 Subject: Adding upstream version 241. Signed-off-by: Daniel Baumann --- src/test/generate-sym-test.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 src/test/generate-sym-test.py (limited to 'src/test/generate-sym-test.py') diff --git a/src/test/generate-sym-test.py b/src/test/generate-sym-test.py new file mode 100755 index 0000000..357cce8 --- /dev/null +++ b/src/test/generate-sym-test.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +import sys, re + +print('#include ') +for header in sys.argv[2:]: + print('#include "{}"'.format(header.split('/')[-1])) + +print(''' +void* functions[] = {''') + +for line in open(sys.argv[1]): + match = re.search('^ +([a-zA-Z0-9_]+);', line) + if match: + print(' {},'.format(match.group(1))) + +print('''}; + +int main(void) { + unsigned i; + for (i = 0; i < sizeof(functions)/sizeof(void*); i++) + printf("%p\\n", functions[i]); + return 0; +}''') -- cgit v1.2.3