2
0
mirror of https://github.com/boostorg/build.git synced 2026-01-19 16:12:14 +00:00
Files
build/test/lang_asm.py
Nikita Kniazev 04d7f31a5a Assembly preprocessing (#224)
Run C preprocessor on assembly source files. Brings gcc-derived toolset behavior to every toolset.
2023-04-15 07:57:25 -05:00

41 lines
941 B
Python

#!/usr/bin/python
# Copyright 2023 Nikita Kniazev
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
# Test that assembler file is actually C-preprocessed.
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
t.write("jamroot.jam", """\
obj hello : hello.S : <define>OK ;
""")
'''
'''
t.write("hello.S", """\
#ifndef __ASSEMBLER__
# error __ASSEMBLER__ expected to be defined
#endif
#if __ASSEMBLER__ != 1
# error __ASSEMBLER__ expected to be defined to value of 1
#endif
#ifndef OK
# error OK was not defined
#endif
// MASM/ARMASM requires END token at the end of the file
#ifdef __GNUC__
# define END
#endif
// whitespace before END is to stop MARMASM from barking 'warning A4045: missing END directive'
END
""")
t.run_build_system(["-d+2", "--debug-configuration"])
t.expect_addition("bin/$toolset/debug*/hello.obj")
t.cleanup()