Added test for mixed C/C++ pch usage.

pull/15/head
Jussi Pakkanen 12 years ago
parent 18ad46d6ef
commit 73f8a69d39
  1. 2
      test cases/14 cxx pch/builder.txt
  2. 4
      test cases/15 mixed pch/builder.txt
  3. 7
      test cases/15 mixed pch/func.c
  4. 10
      test cases/15 mixed pch/main.cc
  5. 1
      test cases/15 mixed pch/pch/func.h
  6. 1
      test cases/15 mixed pch/pch/main.hh

@ -1,3 +1,3 @@
project('c++ pch test', 'c++')
exe = executable('prog', 'prog.cc')
exe.pch('pch/prog.hh')
exe.pch('pch/prog.hh')

@ -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')

@ -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;
}

@ -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();
}
Loading…
Cancel
Save