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

Side by Side Diff: test/win/gyptest-link-ordering.py

Issue 107293004: win msvs: make ordering match .gyp order (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: use OrderedSet instead Created 7 years 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
OLDNEW
(Empty)
1 #!/usr/bin/env python
2
3 # Copyright (c) 2013 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 """
8 Make sure the link order of object files is the same between msvs and ninja.
9 """
10
11 import TestGyp
12
13 import sys
14
15 if sys.platform == 'win32':
16 test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
17
18 CHDIR = 'linker-flags'
19 test.run_gyp('link-ordering.gyp', chdir=CHDIR)
20 test.build('link-ordering.gyp', test.ALL, chdir=CHDIR)
21
22 def GetDisasm(exe):
23 full_path = test.built_file_path(exe, chdir=CHDIR)
24 # Get disassembly and drop int3 padding between functions.
25 return '\n'.join(
26 x for x in test.run_dumpbin('/disasm', full_path).splitlines()
27 if 'CC' not in x)
28
29 # This is the full dump that we expect. The source files in the .gyp match
30 # this order which is what determines the ordering in the binary.
31
32 expected_disasm = '''
33 _mainCRTStartup:
34 00401000: B8 05 00 00 00 mov eax,5
35 00401005: C3 ret
36 ?z@@YAHXZ:
37 00401010: B8 03 00 00 00 mov eax,3
38 00401015: C3 ret
39 ?x@@YAHXZ:
40 00401020: B8 01 00 00 00 mov eax,1
41 00401025: C3 ret
42 ?y@@YAHXZ:
43 00401030: B8 02 00 00 00 mov eax,2
44 00401035: C3 ret
45 _main:
46 00401040: 33 C0 xor eax,eax
47 00401042: C3 ret
48 '''
49
50 if expected_disasm not in GetDisasm('test_ordering_exe.exe'):
51 print GetDisasm('test_ordering_exe.exe')
52 test.fail_test()
53 test.pass_test()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698