diff --git a/test cases/common/24 target arg/func2.c b/test cases/common/24 target arg/func2.c new file mode 100644 index 000000000..d3e91a56c --- /dev/null +++ b/test cases/common/24 target arg/func2.c @@ -0,0 +1,9 @@ +#ifdef CTHING +#error "Local C argument set in wrong target" +#endif + +#ifdef CPPTHING +#error "Local CPP argument set in wrong target" +#endif + +int func() { return 0; } diff --git a/test cases/common/24 target arg/meson.build b/test cases/common/24 target arg/meson.build index 5aec31d8b..11ac006c3 100644 --- a/test cases/common/24 target arg/meson.build +++ b/test cases/common/24 target arg/meson.build @@ -3,5 +3,7 @@ project('local arg test', 'cpp', 'c') exe1 = executable('prog', 'prog.cc', 'func.c', \ c_args : '-DCTHING', \ cpp_args : '-DCPPTHING') +exe2 = executable('prog2', 'prog2.cc', 'func2.c') test('prog1', exe1) +test('prog2', exe2) diff --git a/test cases/common/24 target arg/prog2.cc b/test cases/common/24 target arg/prog2.cc new file mode 100644 index 000000000..ef2fc4b37 --- /dev/null +++ b/test cases/common/24 target arg/prog2.cc @@ -0,0 +1,13 @@ +#ifdef CTHING +#error "Local C argument set in wrong target" +#endif + +#ifdef CPPTHING +#error "Local CPP argument set in wrong target" +#endif + +extern "C" int func(); + +int main(int argc, char **argv) { + return func(); +}