aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-08-06 08:52:41 +0800
committerfanquake <fanquake@gmail.com>2021-08-09 13:59:48 +0800
commit5449d44e37982fcd5251fd47873c5f7d34c39fc9 (patch)
treea4c56a706ca9c4b12e61063c58f0cb89444073e1 /contrib
parent21438d55d553ae5bf3be7c0d4431aaf136db6c6b (diff)
scripts: prevent GCC optimising test symbols in test-symbol-check
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/devtools/test-symbol-check.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/devtools/test-symbol-check.py b/contrib/devtools/test-symbol-check.py
index 7d83c5f751..2da7ae793d 100755
--- a/contrib/devtools/test-symbol-check.py
+++ b/contrib/devtools/test-symbol-check.py
@@ -73,20 +73,21 @@ class TestSymbolChecks(unittest.TestCase):
(1, executable + ': NEEDED library libutil.so.1 is not allowed\n' +
executable + ': failed LIBRARY_DEPENDENCIES'))
- # finally, check a conforming file that simply uses a math function
+ # finally, check a simple conforming binary
source = 'test3.c'
executable = 'test3'
with open(source, 'w', encoding="utf8") as f:
f.write('''
- #include <math.h>
+ #include <stdio.h>
int main()
{
- return (int)pow(2.0, 4.0);
+ printf("42");
+ return 0;
}
''')
- self.assertEqual(call_symbol_check(cc, source, executable, ['-lm']),
+ self.assertEqual(call_symbol_check(cc, source, executable, []),
(0, ''))
def test_MACHO(self):