diff options
author | William Deegan <bill@baddogconsulting.com> | 2023-10-15 01:53:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-15 01:53:20 +0300 |
commit | 3a762666fa0ca7c2d4caf118111dbaf5ccaef317 (patch) | |
tree | d2af9aca5e8eeee343a6e5353f91942881d5b645 | |
parent | 58159bda6135fe497e372fb79bfc8317b4222cb5 (diff) | |
parent | 50783560e935d55dfe0f3e437b978be9ae267788 (diff) |
Merge pull request #4430 from mwichmann/test/asm
Update assembly code in one test
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rw-r--r-- | test/AS/as-live.py | 73 |
2 files changed, 40 insertions, 35 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index ff7ef5062..cf2ae52c4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -184,6 +184,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER Python stdlib types module. - TeX tests: skip tests that use makeindex or epstopdf not installed, or if `kpsewhich glossaries.sty` fails. + - Added a .note.GNU-stack section to the test assembler files to + avoid the GNU linker issuing warnings for its absence. From Jonathon Reinhart: diff --git a/test/AS/as-live.py b/test/AS/as-live.py index 676b5375e..4a21fcf6f 100644 --- a/test/AS/as-live.py +++ b/test/AS/as-live.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify correct use of the live 'as' assembler. @@ -37,24 +36,22 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() - - if not test.detect('AS', 'as'): test.skip_test("as not found; skipping test\n") x86 = (sys.platform == 'win32' or sys.platform.find('linux') != -1) - if not x86: test.skip_test("skipping as test on non-x86 platform '%s'\n" % sys.platform) namelbl = "name" -testccc = """ccc = aaa.Clone(CPPPATH=['.']) -ccc.Program(target = 'ccc', source = ['ccc.S', 'ccc_main.c']) +testccc = """\ +ccc = aaa.Clone(CPPPATH=['.']) +ccc.Program(target='ccc', source=['ccc.S', 'ccc_main.c']) """ if sys.platform == "win32": namelbl = "_name" testccc = "" - + test.write("wrapper.py", """\ import subprocess import sys @@ -66,30 +63,34 @@ subprocess.run(cmd, shell=True) test.write('SConstruct', """\ aaa = Environment() -aaa.Program(target = 'aaa', source = ['aaa.s', 'aaa_main.c']) -bbb = aaa.Clone(AS = r'%(_python_)s wrapper.py ' + WhereIs('as')) -bbb.Program(target = 'bbb', source = ['bbb.s', 'bbb_main.c']) +aaa.Program(target='aaa', source=['aaa.s', 'aaa_main.c']) +bbb = aaa.Clone(AS=r'%(_python_)s wrapper.py ' + WhereIs('as')) +bbb.Program(target='bbb', source=['bbb.s', 'bbb_main.c']) %(testccc)s """ % locals()) -test.write('aaa.s', -""" .file "aaa.s" -.data -.align 4 -.globl %(namelbl)s +test.write('aaa.s', """ + .file "aaa.s" + .data + .align 4 + .globl %(namelbl)s %(namelbl)s: - .ascii "aaa.s" - .byte 0 + .ascii "aaa.s" + .byte 0 + .ident "handcrafted test assembly" + .section .note.GNU-stack,"",@progbits """ % locals()) test.write('bbb.s', """\ -.file "bbb.s" -.data -.align 4 -.globl %(namelbl)s + .file "bbb.s" + .data + .align 4 + .globl %(namelbl)s %(namelbl)s: - .ascii "bbb.s" - .byte 0 + .ascii "bbb.s" + .byte 0 + .ident "handcrafted test assembly" + .section .note.GNU-stack,"",@progbits """ % locals()) test.write('ccc.h', """\ @@ -98,13 +99,15 @@ test.write('ccc.h', """\ test.write('ccc.S', """\ #include <ccc.h> -.file STRING -.data -.align 4 -.globl name + .file STRING + .data + .align 4 + .globl name name: - .ascii STRING - .byte 0 + .ascii STRING + .byte 0 + .ident "handcrafted test assembly" + .section .note.GNU-stack,"",@progbits """) test.write('aaa_main.c', r""" @@ -171,13 +174,13 @@ test.run(program = test.workpath('bbb'), stdout = "bbb_main.c bbb.s\n") if sys.platform != "win32": test.run(program = test.workpath('ccc'), stdout = "ccc_main.c ccc.S\n") - + test.must_match('wrapper.out', "wrapper.py: bbb.s\n") - + test.write("ccc.h", """\ #define STRING "ccc.S 2" """) - + test.run() test.run(program = test.workpath('ccc'), stdout = "ccc_main.c ccc.S 2\n") |