summaryrefslogtreecommitdiffstats
path: root/test cases/unit/86 prelinking
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test cases/unit/86 prelinking/file1.c14
-rw-r--r--test cases/unit/86 prelinking/file2.c9
-rw-r--r--test cases/unit/86 prelinking/file3.c9
-rw-r--r--test cases/unit/86 prelinking/file4.c9
-rw-r--r--test cases/unit/86 prelinking/main.c10
-rw-r--r--test cases/unit/86 prelinking/meson.build7
-rw-r--r--test cases/unit/86 prelinking/private_header.h11
-rw-r--r--test cases/unit/86 prelinking/public_header.h3
8 files changed, 72 insertions, 0 deletions
diff --git a/test cases/unit/86 prelinking/file1.c b/test cases/unit/86 prelinking/file1.c
new file mode 100644
index 0000000..9f0e265
--- /dev/null
+++ b/test cases/unit/86 prelinking/file1.c
@@ -0,0 +1,14 @@
+#include<public_header.h>
+#include<private_header.h>
+
+int public_func() {
+ return round1_a();
+}
+
+int round1_a() {
+ return round1_b();
+}
+
+int round2_a() {
+ return round2_b();
+}
diff --git a/test cases/unit/86 prelinking/file2.c b/test cases/unit/86 prelinking/file2.c
new file mode 100644
index 0000000..ce3b115
--- /dev/null
+++ b/test cases/unit/86 prelinking/file2.c
@@ -0,0 +1,9 @@
+#include<private_header.h>
+
+int round1_b() {
+ return round1_c();
+}
+
+int round2_b() {
+ return round2_c();
+}
diff --git a/test cases/unit/86 prelinking/file3.c b/test cases/unit/86 prelinking/file3.c
new file mode 100644
index 0000000..85052be
--- /dev/null
+++ b/test cases/unit/86 prelinking/file3.c
@@ -0,0 +1,9 @@
+#include<private_header.h>
+
+int round1_c() {
+ return round1_d();
+}
+
+int round2_c() {
+ return round2_d();
+}
diff --git a/test cases/unit/86 prelinking/file4.c b/test cases/unit/86 prelinking/file4.c
new file mode 100644
index 0000000..622364e
--- /dev/null
+++ b/test cases/unit/86 prelinking/file4.c
@@ -0,0 +1,9 @@
+#include<private_header.h>
+
+int round1_d() {
+ return round2_a();
+}
+
+int round2_d() {
+ return 42;
+}
diff --git a/test cases/unit/86 prelinking/main.c b/test cases/unit/86 prelinking/main.c
new file mode 100644
index 0000000..09a2e5c
--- /dev/null
+++ b/test cases/unit/86 prelinking/main.c
@@ -0,0 +1,10 @@
+#include<public_header.h>
+#include<stdio.h>
+
+int main(int argc, char **argv) {
+ if(public_func() != 42) {
+ printf("Something failed.\n");
+ return 1;
+ }
+ return 0;
+}
diff --git a/test cases/unit/86 prelinking/meson.build b/test cases/unit/86 prelinking/meson.build
new file mode 100644
index 0000000..baa9008
--- /dev/null
+++ b/test cases/unit/86 prelinking/meson.build
@@ -0,0 +1,7 @@
+project('prelinking', 'c')
+
+liba = static_library('prelinked', 'file1.c', 'file2.c', 'file3.c', 'file4.c',
+ prelink: true)
+exe = executable('testprog', 'main.c',
+ link_with: liba)
+test('prelinked', exe)
diff --git a/test cases/unit/86 prelinking/private_header.h b/test cases/unit/86 prelinking/private_header.h
new file mode 100644
index 0000000..f24b621
--- /dev/null
+++ b/test cases/unit/86 prelinking/private_header.h
@@ -0,0 +1,11 @@
+#pragma once
+
+int round1_a();
+int round1_b();
+int round1_c();
+int round1_d();
+
+int round2_a();
+int round2_b();
+int round2_c();
+int round2_d();
diff --git a/test cases/unit/86 prelinking/public_header.h b/test cases/unit/86 prelinking/public_header.h
new file mode 100644
index 0000000..0cd6786
--- /dev/null
+++ b/test cases/unit/86 prelinking/public_header.h
@@ -0,0 +1,3 @@
+#pragma once
+
+int public_func();