mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-14 13:50:34 +02:00
scripts: prevent GCC optimising test symbols in test-symbol-check
This commit is contained in:
parent
21438d55d5
commit
5449d44e37
@ -73,20 +73,21 @@ class TestSymbolChecks(unittest.TestCase):
|
|||||||
(1, executable + ': NEEDED library libutil.so.1 is not allowed\n' +
|
(1, executable + ': NEEDED library libutil.so.1 is not allowed\n' +
|
||||||
executable + ': failed LIBRARY_DEPENDENCIES'))
|
executable + ': failed LIBRARY_DEPENDENCIES'))
|
||||||
|
|
||||||
# finally, check a conforming file that simply uses a math function
|
# finally, check a simple conforming binary
|
||||||
source = 'test3.c'
|
source = 'test3.c'
|
||||||
executable = 'test3'
|
executable = 'test3'
|
||||||
with open(source, 'w', encoding="utf8") as f:
|
with open(source, 'w', encoding="utf8") as f:
|
||||||
f.write('''
|
f.write('''
|
||||||
#include <math.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main()
|
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, ''))
|
(0, ''))
|
||||||
|
|
||||||
def test_MACHO(self):
|
def test_MACHO(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user