Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: pylib/gyp/system_test.py

Issue 6883065: make: Expose a 'linker_supports_icf' flag. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pylib/gyp/generator/make.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2011 Google Inc. All rights reserved. 3 # Copyright (c) 2011 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import os 7 import os
8 import tempfile 8 import tempfile
9 import shutil 9 import shutil
10 import subprocess 10 import subprocess
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 env={'ar': ar_command, 'cc': cc_command}) 50 env={'ar': ar_command, 'cc': cc_command})
51 51
52 52
53 def TestLinkerSupportsThreads(cc_command='cc'): 53 def TestLinkerSupportsThreads(cc_command='cc'):
54 """Test whether the linker supports the --threads flag.""" 54 """Test whether the linker supports the --threads flag."""
55 return TestCommands(['%(cc)s -Wl,--threads test.c'], 55 return TestCommands(['%(cc)s -Wl,--threads test.c'],
56 files={'test.c': 'int main(){}'}, 56 files={'test.c': 'int main(){}'},
57 env={'cc': cc_command}) 57 env={'cc': cc_command})
58 58
59 59
60 def TestLinkerSupportsICF(cc_command='cc'):
61 """Test whether the linker supports identical code folding."""
62 return TestCommands(['%(cc)s -Wl,--icf=safe test.c'],
63 files={'test.c': 'int main(){}'},
64 env={'cc': cc_command})
65
66
60 if __name__ == '__main__': 67 if __name__ == '__main__':
61 # Run the various test functions and print the results. 68 # Run the various test functions and print the results.
62 def RunTest(description, function, **kwargs): 69 def RunTest(description, function, **kwargs):
63 print "Testing " + description + ':', 70 print "Testing " + description + ':',
64 if function(**kwargs): 71 if function(**kwargs):
65 print 'ok' 72 print 'ok'
66 else: 73 else:
67 print 'fail' 74 print 'fail'
68 RunTest("ar 'T' flag", TestArSupportsT) 75 RunTest("ar 'T' flag", TestArSupportsT)
69 RunTest("ar 'T' flag with ccache", TestArSupportsT, cc_command='ccache cc') 76 RunTest("ar 'T' flag with ccache", TestArSupportsT, cc_command='ccache cc')
70 RunTest("ld --threads", TestLinkerSupportsThreads) 77 RunTest("ld --threads", TestLinkerSupportsThreads)
OLDNEW
« no previous file with comments | « pylib/gyp/generator/make.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698