summaryrefslogtreecommitdiff
path: root/tests/projects/c/linker_scripts
diff options
context:
space:
mode:
authorruki <[email protected]>2022-02-07 23:51:40 +0800
committerruki <[email protected]>2022-02-07 23:51:40 +0800
commit4ec0ff6570e24ed3e2434cc9f81c728fd002f20c (patch)
tree959d09f1a9635dd066c61a3ed2dab93495805bc8 /tests/projects/c/linker_scripts
parentc88d9afcb3e929d6c0a4f3644399ac3df572829f (diff)
update changelog
Diffstat (limited to 'tests/projects/c/linker_scripts')
-rw-r--r--tests/projects/c/linker_scripts/src/foo.c5
-rw-r--r--tests/projects/c/linker_scripts/src/foo.map7
-rw-r--r--tests/projects/c/linker_scripts/src/main.c8
-rw-r--r--tests/projects/c/linker_scripts/src/main.lds1
-rw-r--r--tests/projects/c/linker_scripts/test.lua6
-rw-r--r--tests/projects/c/linker_scripts/xmake.lua13
6 files changed, 40 insertions, 0 deletions
diff --git a/tests/projects/c/linker_scripts/src/foo.c b/tests/projects/c/linker_scripts/src/foo.c
new file mode 100644
index 000000000..bf480461b
--- /dev/null
+++ b/tests/projects/c/linker_scripts/src/foo.c
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+void foo() {
+ printf("hello world!\n");
+}
diff --git a/tests/projects/c/linker_scripts/src/foo.map b/tests/projects/c/linker_scripts/src/foo.map
new file mode 100644
index 000000000..e593cf4d2
--- /dev/null
+++ b/tests/projects/c/linker_scripts/src/foo.map
@@ -0,0 +1,7 @@
+{
+ global:
+ foo;
+
+ local:
+ *;
+};
diff --git a/tests/projects/c/linker_scripts/src/main.c b/tests/projects/c/linker_scripts/src/main.c
new file mode 100644
index 000000000..8635202c3
--- /dev/null
+++ b/tests/projects/c/linker_scripts/src/main.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+void foo();
+
+int main(int argc, char** argv) {
+ foo();
+ return 0;
+}
diff --git a/tests/projects/c/linker_scripts/src/main.lds b/tests/projects/c/linker_scripts/src/main.lds
new file mode 100644
index 000000000..0e84b7f9c
--- /dev/null
+++ b/tests/projects/c/linker_scripts/src/main.lds
@@ -0,0 +1 @@
+SEARCH_DIR("/lib")
diff --git a/tests/projects/c/linker_scripts/test.lua b/tests/projects/c/linker_scripts/test.lua
new file mode 100644
index 000000000..b76241be2
--- /dev/null
+++ b/tests/projects/c/linker_scripts/test.lua
@@ -0,0 +1,6 @@
+-- main entry
+function main(t)
+
+ -- build project
+ t:build()
+end
diff --git a/tests/projects/c/linker_scripts/xmake.lua b/tests/projects/c/linker_scripts/xmake.lua
new file mode 100644
index 000000000..2396d1b52
--- /dev/null
+++ b/tests/projects/c/linker_scripts/xmake.lua
@@ -0,0 +1,13 @@
+add_rules("mode.debug", "mode.release")
+
+target("test")
+ add_deps("foo")
+ set_kind("binary")
+ add_files("src/main.c")
+ add_files("src/main.lds")
+
+target("foo")
+ set_kind("shared")
+ add_files("src/foo.c")
+ add_files("src/foo.map")
+