diff --git a/test cases/common/272 unity/meson.build b/test cases/common/272 unity/meson.build new file mode 100644 index 000000000000..9acb9b8fe6ff --- /dev/null +++ b/test cases/common/272 unity/meson.build @@ -0,0 +1,13 @@ +project('unity', 'c', + default_options : [ + 'unity_size=2']) + +if get_option('unity') != 'on' + error('MESON_SKIP_TEST: unity builds not enabled') +endif + +slib_notinstalled = static_library('slib_notinstalled', + # test depends on the number of files being divisible by unity_size + ['slib1.c', 'slib2.c']) + +slib_installed = static_library('slib_installed', ['slib1.c', 'slib2.c'], link_with : slib_notinstalled, install : true) diff --git a/test cases/common/272 unity/slib.c b/test cases/common/272 unity/slib.c new file mode 100644 index 000000000000..d7053366a47f --- /dev/null +++ b/test cases/common/272 unity/slib.c @@ -0,0 +1,6 @@ +int func1(void); +int func2(void); + +int static_lib_func(void) { + return func1() + func2(); +} diff --git a/test cases/common/272 unity/slib1.c b/test cases/common/272 unity/slib1.c new file mode 100644 index 000000000000..35304eed65f1 --- /dev/null +++ b/test cases/common/272 unity/slib1.c @@ -0,0 +1,3 @@ +int func1(void) { + return 1; +} diff --git a/test cases/common/272 unity/slib2.c b/test cases/common/272 unity/slib2.c new file mode 100644 index 000000000000..5badf23bcb72 --- /dev/null +++ b/test cases/common/272 unity/slib2.c @@ -0,0 +1,3 @@ +int func2(void) { + return 2; +} diff --git a/test cases/common/272 unity/test.json b/test cases/common/272 unity/test.json new file mode 100644 index 000000000000..0a10fddb5989 --- /dev/null +++ b/test cases/common/272 unity/test.json @@ -0,0 +1,5 @@ +{ + "installed": [ + {"type": "file", "file": "usr/lib/libslib_installed.a"} + ] +}