aboutsummaryrefslogtreecommitdiff
path: root/test cases/common
diff options
context:
space:
mode:
authorNicolas Schneider <nioncode+git@gmail.com>2016-03-24 22:41:34 +0100
committerNicolas Schneider <nioncode+git@gmail.com>2016-03-24 23:44:44 +0100
commit3de7c3471406b3e800b4b87c15febb49e73a9d53 (patch)
tree8cee31f54cdbdd1e844b8934ff33690eb6ad63c2 /test cases/common
parent0c4aab6eed77d62c41006d6944b46f881610599d (diff)
downloadmeson-3de7c3471406b3e800b4b87c15febb49e73a9d53.zip
meson-3de7c3471406b3e800b4b87c15febb49e73a9d53.tar.gz
meson-3de7c3471406b3e800b4b87c15febb49e73a9d53.tar.bz2
add test for extracting two objects with the same source file name
Diffstat (limited to 'test cases/common')
-rw-r--r--test cases/common/110 extract same name/lib.c3
-rw-r--r--test cases/common/110 extract same name/main.c6
-rw-r--r--test cases/common/110 extract same name/meson.build6
-rw-r--r--test cases/common/110 extract same name/src/lib.c3
4 files changed, 18 insertions, 0 deletions
diff --git a/test cases/common/110 extract same name/lib.c b/test cases/common/110 extract same name/lib.c
new file mode 100644
index 0000000..6bdeda7
--- /dev/null
+++ b/test cases/common/110 extract same name/lib.c
@@ -0,0 +1,3 @@
+int func1() {
+ return 23;
+}
diff --git a/test cases/common/110 extract same name/main.c b/test cases/common/110 extract same name/main.c
new file mode 100644
index 0000000..dc57dd5
--- /dev/null
+++ b/test cases/common/110 extract same name/main.c
@@ -0,0 +1,6 @@
+int func1();
+int func2();
+
+int main(int argc, char **argv) {
+ return !(func1() == 23 && func2() == 42);
+}
diff --git a/test cases/common/110 extract same name/meson.build b/test cases/common/110 extract same name/meson.build
new file mode 100644
index 0000000..9384c47
--- /dev/null
+++ b/test cases/common/110 extract same name/meson.build
@@ -0,0 +1,6 @@
+project('object extraction', 'c')
+
+lib = shared_library('somelib', ['lib.c', 'src/lib.c'])
+obj = lib.extract_objects(['lib.c', 'src/lib.c'])
+exe = executable('main', 'main.c', objects: obj)
+test('extraction', exe)
diff --git a/test cases/common/110 extract same name/src/lib.c b/test cases/common/110 extract same name/src/lib.c
new file mode 100644
index 0000000..68e6ab9
--- /dev/null
+++ b/test cases/common/110 extract same name/src/lib.c
@@ -0,0 +1,3 @@
+int func2() {
+ return 42;
+}