diff options
Diffstat (limited to 'meson/test cases/common/145 recursive linking/circular')
8 files changed, 60 insertions, 0 deletions
diff --git a/meson/test cases/common/145 recursive linking/circular/lib1.c b/meson/test cases/common/145 recursive linking/circular/lib1.c new file mode 100644 index 000000000..38889cfa0 --- /dev/null +++ b/meson/test cases/common/145 recursive linking/circular/lib1.c @@ -0,0 +1,6 @@ +int get_st2_prop (void); +int get_st3_prop (void); + +int get_st1_value (void) { + return get_st2_prop () + get_st3_prop (); +} diff --git a/meson/test cases/common/145 recursive linking/circular/lib2.c b/meson/test cases/common/145 recursive linking/circular/lib2.c new file mode 100644 index 000000000..31cd37cc1 --- /dev/null +++ b/meson/test cases/common/145 recursive linking/circular/lib2.c @@ -0,0 +1,6 @@ +int get_st1_prop (void); +int get_st3_prop (void); + +int get_st2_value (void) { + return get_st1_prop () + get_st3_prop (); +} diff --git a/meson/test cases/common/145 recursive linking/circular/lib3.c b/meson/test cases/common/145 recursive linking/circular/lib3.c new file mode 100644 index 000000000..67d473aac --- /dev/null +++ b/meson/test cases/common/145 recursive linking/circular/lib3.c @@ -0,0 +1,6 @@ +int get_st1_prop (void); +int get_st2_prop (void); + +int get_st3_value (void) { + return get_st1_prop () + get_st2_prop (); +} diff --git a/meson/test cases/common/145 recursive linking/circular/main.c b/meson/test cases/common/145 recursive linking/circular/main.c new file mode 100644 index 000000000..164abdf85 --- /dev/null +++ b/meson/test cases/common/145 recursive linking/circular/main.c @@ -0,0 +1,28 @@ +#include <stdio.h> + +#include "../lib.h" + +int get_st1_value (void); +int get_st2_value (void); +int get_st3_value (void); + +int main(void) { + int val; + + val = get_st1_value (); + if (val != 5) { + printf("st1 value was %i instead of 5\n", val); + return -1; + } + val = get_st2_value (); + if (val != 4) { + printf("st2 value was %i instead of 4\n", val); + return -2; + } + val = get_st3_value (); + if (val != 3) { + printf("st3 value was %i instead of 3\n", val); + return -3; + } + return 0; +} diff --git a/meson/test cases/common/145 recursive linking/circular/meson.build b/meson/test cases/common/145 recursive linking/circular/meson.build new file mode 100644 index 000000000..b7a70a86b --- /dev/null +++ b/meson/test cases/common/145 recursive linking/circular/meson.build @@ -0,0 +1,5 @@ +st1 = static_library('st1', 'lib1.c', 'prop1.c') +st2 = static_library('st2', 'lib2.c', 'prop2.c') +st3 = static_library('st3', 'lib3.c', 'prop3.c') + +test('circular', executable('circular', 'main.c', link_with : [st1, st2, st3])) diff --git a/meson/test cases/common/145 recursive linking/circular/prop1.c b/meson/test cases/common/145 recursive linking/circular/prop1.c new file mode 100644 index 000000000..4e571f5ee --- /dev/null +++ b/meson/test cases/common/145 recursive linking/circular/prop1.c @@ -0,0 +1,3 @@ +int get_st1_prop (void) { + return 1; +} diff --git a/meson/test cases/common/145 recursive linking/circular/prop2.c b/meson/test cases/common/145 recursive linking/circular/prop2.c new file mode 100644 index 000000000..ceabba055 --- /dev/null +++ b/meson/test cases/common/145 recursive linking/circular/prop2.c @@ -0,0 +1,3 @@ +int get_st2_prop (void) { + return 2; +} diff --git a/meson/test cases/common/145 recursive linking/circular/prop3.c b/meson/test cases/common/145 recursive linking/circular/prop3.c new file mode 100644 index 000000000..246206c2c --- /dev/null +++ b/meson/test cases/common/145 recursive linking/circular/prop3.c @@ -0,0 +1,3 @@ +int get_st3_prop (void) { + return 3; +} |