OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 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 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 # Test that local variable dwarf info is preserved with linking and LTO. | 283 # Test that local variable dwarf info is preserved with linking and LTO. |
284 # Force '-g' on in case it was not turned on for some reason, and lower | 284 # Force '-g' on in case it was not turned on for some reason, and lower |
285 # optimization settings to prevent some optimizations that would convert | 285 # optimization settings to prevent some optimizations that would convert |
286 # locals from llvm allocas to registers. | 286 # locals from llvm allocas to registers. |
287 # We may be able to remove this test once LLVM has an upstream regression test. | 287 # We may be able to remove this test once LLVM has an upstream regression test. |
288 debug_env = env.Clone() | 288 debug_env = env.Clone() |
289 debug_env.Append(CFLAGS=['-g', '-O0']) | 289 debug_env.Append(CFLAGS=['-g', '-O0']) |
290 debug_env.Append(CCFLAGS=['-g', '-O0']) | 290 debug_env.Append(CCFLAGS=['-g', '-O0']) |
291 debug_env.Append(LINKFLAGS=['-O0']) | 291 debug_env.Append(LINKFLAGS=['-O0']) |
292 dwarf_local_var_nexe = debug_env.ComponentProgram('dwarf_local_var', | 292 # This requires preserving nonstable bitcode debug metadata. |
293 ['dwarf_local_var.c', | 293 if debug_env.Bit('bitcode'): |
294 'dwarf_local_var_dummy.c'], | 294 debug_env.SetBits('nonstable_bitcode') |
295 EXTRA_LIBS=['${NONIRT_LIBS}']) | 295 if not debug_env.Bit('skip_nonstable_bitcode'): |
296 # Sanity-check -- make sure it runs. | 296 dwarf_local_var_nexe = debug_env.ComponentProgram( |
297 node = debug_env.CommandSelLdrTestNacl('dwarf_local_var_run.out', | 297 'dwarf_local_var', |
298 dwarf_local_var_nexe, | 298 ['dwarf_local_var.c', |
299 exit_status=55) | 299 'dwarf_local_var_dummy.c'], |
300 debug_env.AddNodeToTestSuite(node, | 300 EXTRA_LIBS=['${NONIRT_LIBS}']) |
301 ['toolchain_tests', 'small_tests'], | 301 # Sanity-check -- make sure it runs. |
302 'run_dwarf_local_var_run_test') | 302 node = debug_env.CommandSelLdrTestNacl('dwarf_local_var_run.out', |
303 node = debug_env.CommandTestFileDumpCheck('dwarf_local_var_objdump.out', | 303 dwarf_local_var_nexe, |
304 dwarf_local_var_nexe, | 304 exit_status=55) |
305 debug_env.File('dwarf_local_var.c'), | 305 debug_env.AddNodeToTestSuite(node, |
306 '-W') | 306 ['toolchain_tests', 'small_tests'], |
307 debug_env.AddNodeToTestSuite(node, | 307 'run_dwarf_local_var_run_test') |
308 ['small_tests', 'toolchain_tests'], | 308 node = debug_env.CommandTestFileDumpCheck('dwarf_local_var_objdump.out', |
309 'run_dwarf_local_var_objdump_test') | 309 dwarf_local_var_nexe, |
| 310 debug_env.File('dwarf_local_var.c'), |
| 311 '-W') |
| 312 debug_env.AddNodeToTestSuite(node, |
| 313 ['small_tests', 'toolchain_tests'], |
| 314 'run_dwarf_local_var_objdump_test') |
310 | 315 |
311 if env.Bit('nacl_glibc'): | 316 if env.Bit('nacl_glibc'): |
312 nexe = env.ComponentProgram('byteswap64', 'byteswap64.c', | 317 nexe = env.ComponentProgram('byteswap64', 'byteswap64.c', |
313 EXTRA_LIBS=['${NONIRT_LIBS}']) | 318 EXTRA_LIBS=['${NONIRT_LIBS}']) |
314 node = env.CommandSelLdrTestNacl('byteswap64.out', nexe) | 319 node = env.CommandSelLdrTestNacl('byteswap64.out', nexe) |
315 env.AddNodeToTestSuite(node, | 320 env.AddNodeToTestSuite(node, |
316 ['toolchain_tests', 'small_tests'], | 321 ['toolchain_tests', 'small_tests'], |
317 'run_byteswap64_test') | 322 'run_byteswap64_test') |
318 | 323 |
319 # Test that using link-time optimization does not convert calls to | 324 # Test that using link-time optimization does not convert calls to |
320 # library functions that were never linked in. | 325 # library functions that were never linked in. |
321 if env.Bit('bitcode'): | 326 if env.Bit('bitcode'): |
322 unopt_env = env.Clone() | 327 unopt_env = env.Clone() |
323 unopt_env.Append(CFLAGS=['-O0']) | 328 unopt_env.Append(CFLAGS=['-O0']) |
324 unopt_env.Append(CCFLAGS=['-O0']) | 329 unopt_env.Append(CCFLAGS=['-O0']) |
325 opt_env = env.Clone() | 330 opt_env = env.Clone() |
326 opt_env.Append(CFLAGS=['-O3']) | 331 opt_env.Append(CFLAGS=['-O3']) |
327 opt_env.Append(CCFLAGS=['-O3']) | 332 opt_env.Append(CCFLAGS=['-O3']) |
328 opt_env.Append(LINKFLAGS=['-O3']) | 333 opt_env.Append(LINKFLAGS=['-O3']) |
329 obj = unopt_env.ComponentObject('printf_to_puts.c') | 334 obj = unopt_env.ComponentObject('printf_to_puts.c') |
330 nexe = opt_env.ComponentProgram('printf_to_puts', | 335 nexe = opt_env.ComponentProgram('printf_to_puts', |
331 obj, | 336 obj, |
332 EXTRA_LIBS=['${NONIRT_LIBS}']) | 337 EXTRA_LIBS=['${NONIRT_LIBS}']) |
333 node = env.CommandSelLdrTestNacl('printf_to_puts.out', nexe) | 338 node = env.CommandSelLdrTestNacl('printf_to_puts.out', nexe) |
334 env.AddNodeToTestSuite(node, | 339 env.AddNodeToTestSuite(node, |
335 ['toolchain_tests', 'small_tests'], | 340 ['toolchain_tests', 'small_tests'], |
336 'run_printf_to_puts_test') | 341 'run_printf_to_puts_test') |
OLD | NEW |