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
pull/13788/head
Pierre Lamot 4 months ago committed by Jussi Pakkanen
parent e1c09ee25f
commit 83d9b21401
  1. 6
      test cases/common/52 object generator/dir/meson.build
  2. 3
      test cases/common/52 object generator/dir/source5.c
  3. 3
      test cases/common/52 object generator/dir/source6.c
  4. 4
      test cases/common/52 object generator/meson.build
  5. 5
      test cases/common/52 object generator/prog.c

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

@ -0,0 +1,3 @@
int func5_in_obj(void) {
return 0;
}

@ -0,0 +1,3 @@
int func6_in_obj(void) {
return 0;
}

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

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

Loading…
Cancel
Save