]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/c_file.py
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / test / c_file.py
1 #!/usr/bin/python
2
3 # Copyright 2003 Vladimir Prus
4 # Distributed under the Boost Software License, Version 1.0.
5 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
6
7 # Test that C files are compiled by a C compiler.
8
9 import BoostBuild
10
11 t = BoostBuild.Tester(use_test_config=False)
12
13 t.write("jamroot.jam", """
14 project ;
15 exe hello : hello.cpp a.c ;
16 """)
17
18 t.write("hello.cpp", """
19 extern "C" int foo();
20 int main() { return foo(); }
21 """)
22
23 t.write("a.c", """
24 // This will not compile unless in C mode.
25 int foo()
26 {
27 int new = 0;
28 new = (new+1)*7;
29 return new;
30 }
31 """)
32
33 t.run_build_system()
34 t.expect_addition("bin/$toolset/debug*/hello.exe")
35
36 t.cleanup()