diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-01-13 21:11:56 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-01-13 21:11:56 +0200 |
commit | 73f8a69d3942c1ce6ecb0fa19afca3a46341dee3 (patch) | |
tree | a30aec1d48879a701659af43be2dd80ce22ea782 | |
parent | 18ad46d6efe732a2643df8186e2a1befd1748d35 (diff) | |
download | meson-73f8a69d3942c1ce6ecb0fa19afca3a46341dee3.zip meson-73f8a69d3942c1ce6ecb0fa19afca3a46341dee3.tar.gz meson-73f8a69d3942c1ce6ecb0fa19afca3a46341dee3.tar.bz2 |
Added test for mixed C/C++ pch usage.
-rw-r--r-- | test cases/14 cxx pch/builder.txt | 2 | ||||
-rw-r--r-- | test cases/15 mixed pch/builder.txt | 4 | ||||
-rw-r--r-- | test cases/15 mixed pch/func.c | 7 | ||||
-rw-r--r-- | test cases/15 mixed pch/main.cc | 10 | ||||
-rw-r--r-- | test cases/15 mixed pch/pch/func.h | 1 | ||||
-rw-r--r-- | test cases/15 mixed pch/pch/main.hh | 1 |
6 files changed, 24 insertions, 1 deletions
diff --git a/test cases/14 cxx pch/builder.txt b/test cases/14 cxx pch/builder.txt index 8d27a17..0c6396a 100644 --- a/test cases/14 cxx pch/builder.txt +++ b/test cases/14 cxx pch/builder.txt @@ -1,3 +1,3 @@ project('c++ pch test', 'c++') exe = executable('prog', 'prog.cc') -exe.pch('pch/prog.hh')
\ No newline at end of file +exe.pch('pch/prog.hh') diff --git a/test cases/15 mixed pch/builder.txt b/test cases/15 mixed pch/builder.txt new file mode 100644 index 0000000..c8e03f1 --- /dev/null +++ b/test cases/15 mixed pch/builder.txt @@ -0,0 +1,4 @@ +project('mixed C and C++ pch test', 'c++', 'c') + +exe = executable('prog', 'main.cc', 'func.c') +exe.pch('pch/main.hh', 'pch/func.h') diff --git a/test cases/15 mixed pch/func.c b/test cases/15 mixed pch/func.c new file mode 100644 index 0000000..c02722e --- /dev/null +++ b/test cases/15 mixed pch/func.c @@ -0,0 +1,7 @@ +void tmp_func() { + fprintf(stdout, "This is a function that fails if stdio is not #included.\n"); +} + +int cfunc() { + return 0; +} diff --git a/test cases/15 mixed pch/main.cc b/test cases/15 mixed pch/main.cc new file mode 100644 index 0000000..44d049e --- /dev/null +++ b/test cases/15 mixed pch/main.cc @@ -0,0 +1,10 @@ +extern "C" int cfunc(); + +void func() { + std::cout << "This is a function that fails to compile if iostream is not included." + << std::endl; +} + +int main(int argc, char **argv) { + return cfunc(); +} diff --git a/test cases/15 mixed pch/pch/func.h b/test cases/15 mixed pch/pch/func.h new file mode 100644 index 0000000..354499a --- /dev/null +++ b/test cases/15 mixed pch/pch/func.h @@ -0,0 +1 @@ +#include<stdio.h> diff --git a/test cases/15 mixed pch/pch/main.hh b/test cases/15 mixed pch/pch/main.hh new file mode 100644 index 0000000..751cc4a --- /dev/null +++ b/test cases/15 mixed pch/pch/main.hh @@ -0,0 +1 @@ +#include<iostream> |