From d94bf577044859ac4a11580bcfa9702465bc8489 Mon Sep 17 00:00:00 2001 From: Pierre Lamot Date: Thu, 8 Aug 2024 11:06:09 +0200 Subject: [PATCH] test cases: add test for @OUTPUT0@ substitution rules when a generator used a single @OUTPUT0@ and was processing multiple targets, the variable was replaced with a wrong value --- test cases/common/52 object generator/dir/meson.build | 6 ++++++ test cases/common/52 object generator/dir/source5.c | 3 +++ test cases/common/52 object generator/dir/source6.c | 3 +++ test cases/common/52 object generator/meson.build | 4 +++- test cases/common/52 object generator/prog.c | 5 ++++- 5 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 test cases/common/52 object generator/dir/meson.build create mode 100644 test cases/common/52 object generator/dir/source5.c create mode 100644 test cases/common/52 object generator/dir/source6.c diff --git a/test cases/common/52 object generator/dir/meson.build b/test cases/common/52 object generator/dir/meson.build new file mode 100644 index 000000000000..e661d8665499 --- /dev/null +++ b/test cases/common/52 object generator/dir/meson.build @@ -0,0 +1,6 @@ +#check with a single @OUTPUT0@ in a subdirectory and multiple inputs +gen4 = generator(python, + output : ['@BASENAME@.o'], + arguments : [comp, cc, '@INPUT@', '@OUTPUT0@']) + +generated4 = gen4.process(files('source5.c', 'source6.c')) diff --git a/test cases/common/52 object generator/dir/source5.c b/test cases/common/52 object generator/dir/source5.c new file mode 100644 index 000000000000..c512fc310279 --- /dev/null +++ b/test cases/common/52 object generator/dir/source5.c @@ -0,0 +1,3 @@ +int func5_in_obj(void) { + return 0; +} diff --git a/test cases/common/52 object generator/dir/source6.c b/test cases/common/52 object generator/dir/source6.c new file mode 100644 index 000000000000..adcf2cd454fd --- /dev/null +++ b/test cases/common/52 object generator/dir/source6.c @@ -0,0 +1,3 @@ +int func6_in_obj(void) { + return 0; +} diff --git a/test cases/common/52 object generator/meson.build b/test cases/common/52 object generator/meson.build index 49590d6d60f9..656a9088586f 100644 --- a/test cases/common/52 object generator/meson.build +++ b/test cases/common/52 object generator/meson.build @@ -37,6 +37,8 @@ gen3 = generator(python, generated3 = gen3.process(['source4.c']) -e = executable('prog', 'prog.c', generated, generated2, generated3) +subdir('dir') + +e = executable('prog', 'prog.c', generated, generated2, generated3, generated4) test('objgen', e) \ No newline at end of file diff --git a/test cases/common/52 object generator/prog.c b/test cases/common/52 object generator/prog.c index 80056dc031a9..ce54b073939a 100644 --- a/test cases/common/52 object generator/prog.c +++ b/test cases/common/52 object generator/prog.c @@ -2,7 +2,10 @@ int func1_in_obj(void); int func2_in_obj(void); int func3_in_obj(void); int func4_in_obj(void); +int func5_in_obj(void); +int func6_in_obj(void); + int main(void) { - return func1_in_obj() + func2_in_obj() + func3_in_obj() + func4_in_obj(); + return func1_in_obj() + func2_in_obj() + func3_in_obj() + func4_in_obj() + func5_in_obj() + func6_in_obj(); }