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

Side by Side Diff: tests/toolchain/nacl.scons

Issue 508823007: Expose LLC's -force-align-stack flag to pnacl-translate (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: add test Created 6 years, 3 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
OLDNEW
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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 env.ComponentLibrary('wrap_lib', ['wrap_lib1.c', 'wrap_lib2.c']) 548 env.ComponentLibrary('wrap_lib', ['wrap_lib1.c', 'wrap_lib2.c'])
549 nexe = env.ComponentProgram('wrap', ['wrap_main.c'], 549 nexe = env.ComponentProgram('wrap', ['wrap_main.c'],
550 EXTRA_LINKFLAGS=WRAP_LINK_FLAGS, 550 EXTRA_LINKFLAGS=WRAP_LINK_FLAGS,
551 EXTRA_LIBS=['wrap_lib', '${NONIRT_LIBS}']) 551 EXTRA_LIBS=['wrap_lib', '${NONIRT_LIBS}'])
552 node = env.CommandSelLdrTestNacl('wrap.out', nexe, 552 node = env.CommandSelLdrTestNacl('wrap.out', nexe,
553 stdout_golden=env.File('wrap.stdout')) 553 stdout_golden=env.File('wrap.stdout'))
554 env.AddNodeToTestSuite(node, ['toolchain_tests','small_tests'], 'run_wrap_test') 554 env.AddNodeToTestSuite(node, ['toolchain_tests','small_tests'], 'run_wrap_test')
555 555
556 if (env.Bit('target_x86_32') and env.Bit('bitcode') and 556 if (env.Bit('target_x86_32') and env.Bit('bitcode') and
557 not env.Bit('pnacl_generate_pexe') and 557 not env.Bit('pnacl_generate_pexe') and
558 env['TOOLCHAIN_FEATURE_VERSION'] >= 7): 558 env['TOOLCHAIN_FEATURE_VERSION'] >= 8):
559 # This test compiles a file that will need to generate a call to a compiler-rt 559 # This test compiles a file that will need to generate a call to a compiler-rt
560 # function (__udivdi3) on x86-32. Ensure that when we pre-translate to a 560 # function (__udivdi3) on x86-32. Ensure that when we pre-translate to a
561 # native object file, libgcc is included in the bitcode link to satisfy the 561 # native object file, libgcc is included in the bitcode link to satisfy the
562 # reference. 562 # reference.
563 mixedlink_env = env.Clone() 563 mixedlink_env = env.Clone()
564 mixedlink_env.Append(CCFLAGS=['--pnacl-allow-translate', 564 mixedlink_env.Append(CCFLAGS=['--pnacl-allow-translate',
565 '--pnacl-allow-native', 565 '--pnacl-allow-native',
566 '-arch', 'x86-32']) 566 '-arch', 'x86-32'])
567 mixedlink_env.Append(LINKFLAGS=['--pnacl-allow-translate', 567 mixedlink_env.Append(LINKFLAGS=['--pnacl-allow-translate',
568 '--pnacl-allow-native', 568 '--pnacl-allow-native',
569 '-arch', 'x86-32']) 569 '-arch', 'x86-32'])
570
570 nexe = mixedlink_env.ComponentProgram('libgcc_mixed_link', 'needs_libgcc.c', 571 nexe = mixedlink_env.ComponentProgram('libgcc_mixed_link', 'needs_libgcc.c',
571 EXTRA_LIBS=['${NONIRT_LIBS}']) 572 EXTRA_LIBS=['${NONIRT_LIBS}'])
572 node = mixedlink_env.CommandSelLdrTestNacl('libgcc_mixed_link.out', nexe, 573 node = mixedlink_env.CommandSelLdrTestNacl('libgcc_mixed_link.out', nexe,
573 ['9', '3']) 574 ['9', '3'])
574 mixedlink_env.AddNodeToTestSuite(node, ['nonpexe_tests', 'small_tests'], 575 mixedlink_env.AddNodeToTestSuite(node, ['nonpexe_tests', 'small_tests',
576 'toolchain_tests'],
575 'run_libgcc_mixed_link_test') 577 'run_libgcc_mixed_link_test')
578
579 # This tests the translator's -force-align-stack flag, which means that the
580 # compiler cannot assume that the stack pointer is aligned to a 16-byte
581 # boundary, and must force realignment on entry to each function.
582 mixedlink_env.Append(ASFLAGS=['-arch', 'x86-32'])
583 mixedlink_env.Append(CCFLAGS=['-Wt,-force-align-stack'])
584 obj1 = mixedlink_env.ComponentObject('call_with_misaligned_stack.S')
Mark Seaborn 2014/08/28 19:13:13 I suspect you don't need ComponentObject. Can the
Derek Schuff 2014/08/28 22:07:24 Done.
585 obj2 = mixedlink_env.ComponentObject('stackalign_test.c')
586 nexe = mixedlink_env.ComponentProgram('stackalign_test', [obj1, obj2],
587 EXTRA_LIBS=['${NONIRT_LIBS}'])
588 node = mixedlink_env.CommandSelLdrTestNacl('stackalign.out', nexe)
589 mixedlink_env.AddNodeToTestSuite(node, ['nonpexe_tests', 'small_tests',
590 'toolchain_tests'],
Mark Seaborn 2014/08/28 19:13:13 Nit: fix indentation alignment
Derek Schuff 2014/08/28 22:07:24 Done.
591 'run_stackalign_test')
Mark Seaborn 2014/08/28 19:13:13 Nit: fix indentation alignment here too
Derek Schuff 2014/08/28 22:07:24 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698