OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 Import('env') | 6 Import('env') |
7 | 7 |
8 # force inclusion of entire library, so that we can validate it | 8 # force inclusion of entire library, so that we can validate it |
9 # NOTE: This approach does not work for -lc because of tons of | 9 # NOTE: This approach does not work for -lc because of tons of |
10 # undefined symbols which would have to be stubbed out | 10 # undefined symbols which would have to be stubbed out |
11 wa_env = env.Clone() | 11 wa_env = env.Clone() |
12 if not wa_env.Bit('bitcode'): | 12 if not wa_env.Bit('bitcode'): |
13 # NOTE: the pnacl linker does not understand '-Wl,-whole-archive' | 13 # NOTE: the pnacl linker does not understand '-Wl,-whole-archive' |
14 # c.f. http://code.google.com/p/nativeclient/issues/detail?id=943 | 14 # c.f. http://code.google.com/p/nativeclient/issues/detail?id=943 |
15 wa_env.Prepend(LINKFLAGS=['-Wl,-whole-archive', | 15 wa_env.Prepend(LINKFLAGS=['-Wl,-whole-archive', |
16 '-lgcc', | 16 '-lgcc', |
17 '-lm', | 17 '-lm', |
18 '-lnacl', | 18 '-lnacl', |
19 '-lsrpc', | 19 '-lsrpc', |
20 '-limc_syscalls', | 20 '-limc_syscalls', |
21 '-lplatform', | 21 '-lplatform', |
22 '-lgio', | 22 '-lgio', |
23 '-lpthread', | 23 '-lpthread', |
24 '-Wl,-no-whole-archive']) | 24 '-Wl,-no-whole-archive']) |
25 | 25 |
26 | 26 |
27 nexe = wa_env.ComponentProgram('dummy.nexe', 'dummy.c') | 27 nexe = wa_env.ComponentProgram('dummy', 'dummy.c') |
28 node = wa_env.CommandValidatorTestNacl('whole_archive_test.out', | 28 node = wa_env.CommandValidatorTestNacl('whole_archive_test.out', |
29 image=[nexe]) | 29 image=[nexe]) |
30 wa_env.AddNodeToTestSuite(node, | 30 wa_env.AddNodeToTestSuite(node, |
31 ['toolchain_tests', 'small_tests'], | 31 ['toolchain_tests', 'small_tests'], |
32 'run_whole_archive_test') | 32 'run_whole_archive_test') |
33 | 33 |
34 nexe = env.ComponentProgram('setlongjmp.nexe', 'setlongjmp.c') | 34 nexe = env.ComponentProgram('setlongjmp', 'setlongjmp.c') |
35 node = env.CommandSelLdrTestNacl('setlongjmp.out', | 35 node = env.CommandSelLdrTestNacl('setlongjmp.out', |
36 command=[nexe], | 36 nexe, |
37 exit_status='55') | 37 exit_status='55') |
38 env.AddNodeToTestSuite(node, | 38 env.AddNodeToTestSuite(node, |
39 ['toolchain_tests','small_tests'], | 39 ['toolchain_tests','small_tests'], |
40 'run_setlongjmp_test') | 40 'run_setlongjmp_test') |
41 | 41 |
42 nexe = env.ComponentProgram('intrinsics.nexe', 'intrinsics.cc') | 42 nexe = env.ComponentProgram('intrinsics', 'intrinsics.cc') |
43 node = env.CommandSelLdrTestNacl('intrinsics.out', | 43 node = env.CommandSelLdrTestNacl('intrinsics.out', |
44 command=[nexe], | 44 nexe, |
45 exit_status='55') | 45 exit_status='55') |
46 env.AddNodeToTestSuite(node, | 46 env.AddNodeToTestSuite(node, |
47 ['toolchain_tests','small_tests'], | 47 ['toolchain_tests','small_tests'], |
48 'run_intrinsics_test') | 48 'run_intrinsics_test') |
49 | 49 |
50 nexe = env.ComponentProgram('float2.nexe', 'float2.c') | 50 nexe = env.ComponentProgram('float2', 'float2.c') |
51 node = env.CommandSelLdrTestNacl('float2.out', | 51 node = env.CommandSelLdrTestNacl('float2.out', |
52 command=[nexe], | 52 nexe, |
53 stdout_golden=env.File('float2.stdout')) | 53 stdout_golden=env.File('float2.stdout')) |
54 env.AddNodeToTestSuite(node, | 54 env.AddNodeToTestSuite(node, |
55 ['toolchain_tests','small_tests'], | 55 ['toolchain_tests','small_tests'], |
56 'run_float2_test') | 56 'run_float2_test') |
57 | 57 |
58 | 58 |
59 nexe = env.ComponentProgram('initfini.nexe', 'initfini.c') | 59 nexe = env.ComponentProgram('initfini', 'initfini.c') |
60 node = env.CommandSelLdrTestNacl('initfini.out', | 60 node = env.CommandSelLdrTestNacl('initfini.out', |
61 command=[nexe], | 61 nexe, |
62 stdout_golden=env.File('initfini.stdout')) | 62 stdout_golden=env.File('initfini.stdout')) |
63 | 63 |
64 # NOTE: this currently only works for PNaCl, c.f: | 64 # NOTE: this currently only works for PNaCl, c.f: |
65 # http://code.google.com/p/nativeclient/issues/detail?id=968 | 65 # http://code.google.com/p/nativeclient/issues/detail?id=968 |
66 env.AddNodeToTestSuite(node, ['toolchain_tests', 'small_tests'], | 66 env.AddNodeToTestSuite(node, ['toolchain_tests', 'small_tests'], |
67 'run_initfini_test', is_broken=not env.Bit('bitcode')) | 67 'run_initfini_test', is_broken=not env.Bit('bitcode')) |
68 | 68 |
69 | 69 |
70 # NOTE: the tests below break easily under valgrid and since | 70 # NOTE: the tests below break easily under valgrid and since |
71 # they do not exercise malloc/free we exclude | 71 # they do not exercise malloc/free we exclude |
72 if env.IsRunningUnderValgrind(): | 72 if env.IsRunningUnderValgrind(): |
73 Return() | 73 Return() |
74 | 74 |
75 | 75 |
76 sloppy_env = env.Clone() | 76 sloppy_env = env.Clone() |
77 # return_address test has some casts the compiler does not like | 77 # return_address test has some casts the compiler does not like |
78 sloppy_env.FilterOut(CFLAGS=['-pedantic', '-O2']) | 78 sloppy_env.FilterOut(CFLAGS=['-pedantic', '-O2']) |
79 sloppy_env.FilterOut(CCFLAGS=['-pedantic', '-O2']) | 79 sloppy_env.FilterOut(CCFLAGS=['-pedantic', '-O2']) |
80 # lto inlining breaks this test | 80 # lto inlining breaks this test |
81 if env.Bit('bitcode'): | 81 if env.Bit('bitcode'): |
82 sloppy_env.FilterOut(LINKFLAGS=['-O3']) | 82 sloppy_env.FilterOut(LINKFLAGS=['-O3']) |
83 | 83 |
84 nexe = sloppy_env.ComponentProgram('return_address.nexe', 'return_address.c') | 84 nexe = sloppy_env.ComponentProgram('return_address', 'return_address.c') |
85 node = sloppy_env.CommandSelLdrTestNacl('return_address.out', | 85 node = sloppy_env.CommandSelLdrTestNacl('return_address.out', |
86 command=[nexe], | 86 nexe, |
87 exit_status='55') | 87 exit_status='55') |
88 sloppy_env.AddNodeToTestSuite(node, | 88 sloppy_env.AddNodeToTestSuite(node, |
89 ['toolchain_tests', 'small_tests'], | 89 ['toolchain_tests', 'small_tests'], |
90 'run_return_address_test') | 90 'run_return_address_test') |
91 | 91 |
92 # NOTE: we assume that the incoming env contains '-O2', '-fomit-frame-pointer' | 92 # NOTE: we assume that the incoming env contains '-O2', '-fomit-frame-pointer' |
93 def MakeEnv(use_opts, use_frames): | 93 def MakeEnv(use_opts, use_frames): |
94 new_env = env.Clone() | 94 new_env = env.Clone() |
95 new_env.Append(CPPDEFINES=['TARGET_FULLARCH=${TARGET_FULLARCH}']) | 95 new_env.Append(CPPDEFINES=['TARGET_FULLARCH=${TARGET_FULLARCH}']) |
96 new_env.FilterOut(CFLAGS=['-pedantic']) | 96 new_env.FilterOut(CFLAGS=['-pedantic']) |
(...skipping 30 matching lines...) Expand all Loading... |
127 'eh_loop_many.cc', | 127 'eh_loop_many.cc', |
128 'eh_catch_many.cc', | 128 'eh_catch_many.cc', |
129 'eh_loop_break.cc']: | 129 'eh_loop_break.cc']: |
130 is_broken = False | 130 is_broken = False |
131 if src in ['unwind_trace.cc', 'stack_frame.cc']: | 131 if src in ['unwind_trace.cc', 'stack_frame.cc']: |
132 # the tracing gets messed up by optimizations | 132 # the tracing gets messed up by optimizations |
133 is_broken |= tag.startswith('opt') | 133 is_broken |= tag.startswith('opt') |
134 | 134 |
135 name = src.split('.')[0] + '_' + tag | 135 name = src.split('.')[0] + '_' + tag |
136 nobj = e.ComponentObject(name + '.o', src) | 136 nobj = e.ComponentObject(name + '.o', src) |
137 nexe = e.ComponentProgram(name + '.nexe', nobj) | 137 nexe = e.ComponentProgram(name, nobj) |
138 node = e.CommandSelLdrTestNacl(name + '.out', | 138 node = e.CommandSelLdrTestNacl(name + '.out', |
139 command=[nexe], | 139 nexe, |
140 exit_status='55') | 140 exit_status='55') |
141 e.AddNodeToTestSuite(node, ['toolchain_tests', 'small_tests'], | 141 e.AddNodeToTestSuite(node, ['toolchain_tests', 'small_tests'], |
142 'run_' + name +'_test', is_broken=is_broken) | 142 'run_' + name +'_test', is_broken=is_broken) |
OLD | NEW |