summaryrefslogtreecommitdiffstats
path: root/Tests/Dependency/Case1
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Dependency/Case1')
-rw-r--r--Tests/Dependency/Case1/CMakeLists.txt19
-rw-r--r--Tests/Dependency/Case1/a.c4
-rw-r--r--Tests/Dependency/Case1/b.c6
-rw-r--r--Tests/Dependency/Case1/b2.c4
-rw-r--r--Tests/Dependency/Case1/c.c6
-rw-r--r--Tests/Dependency/Case1/c2.c6
-rw-r--r--Tests/Dependency/Case1/d.c6
-rw-r--r--Tests/Dependency/Case1/main.c10
8 files changed, 61 insertions, 0 deletions
diff --git a/Tests/Dependency/Case1/CMakeLists.txt b/Tests/Dependency/Case1/CMakeLists.txt
new file mode 100644
index 0000000..4c5fc20
--- /dev/null
+++ b/Tests/Dependency/Case1/CMakeLists.txt
@@ -0,0 +1,19 @@
+project(CASE1)
+
+# The old anaylize lib depends stuff in cmTarget gets this case wrong.
+# The cmComputeLinkDepends implementation gets it right.
+
+add_library(case1a STATIC a.c)
+
+add_library(case1b STATIC b.c b2.c)
+target_link_libraries(case1b case1a)
+
+add_library(case1c STATIC c.c c2.c)
+target_link_libraries(case1c case1b)
+
+add_library(case1d STATIC d.c)
+target_link_libraries(case1d case1c)
+
+add_executable(hello main.c)
+target_link_libraries(hello case1c case1b case1d case1c)
+
diff --git a/Tests/Dependency/Case1/a.c b/Tests/Dependency/Case1/a.c
new file mode 100644
index 0000000..262f523
--- /dev/null
+++ b/Tests/Dependency/Case1/a.c
@@ -0,0 +1,4 @@
+int a()
+{
+ return 5;
+}
diff --git a/Tests/Dependency/Case1/b.c b/Tests/Dependency/Case1/b.c
new file mode 100644
index 0000000..deda685
--- /dev/null
+++ b/Tests/Dependency/Case1/b.c
@@ -0,0 +1,6 @@
+extern int a();
+
+int b()
+{
+ return a() + 17;
+}
diff --git a/Tests/Dependency/Case1/b2.c b/Tests/Dependency/Case1/b2.c
new file mode 100644
index 0000000..f341da7
--- /dev/null
+++ b/Tests/Dependency/Case1/b2.c
@@ -0,0 +1,4 @@
+int b2()
+{
+ return 3;
+}
diff --git a/Tests/Dependency/Case1/c.c b/Tests/Dependency/Case1/c.c
new file mode 100644
index 0000000..a3ec162
--- /dev/null
+++ b/Tests/Dependency/Case1/c.c
@@ -0,0 +1,6 @@
+extern int b();
+
+int c()
+{
+ return b() + 42;
+}
diff --git a/Tests/Dependency/Case1/c2.c b/Tests/Dependency/Case1/c2.c
new file mode 100644
index 0000000..317bb0f
--- /dev/null
+++ b/Tests/Dependency/Case1/c2.c
@@ -0,0 +1,6 @@
+extern int b2();
+
+int c2()
+{
+ return b2() + 1;
+}
diff --git a/Tests/Dependency/Case1/d.c b/Tests/Dependency/Case1/d.c
new file mode 100644
index 0000000..f67aef7
--- /dev/null
+++ b/Tests/Dependency/Case1/d.c
@@ -0,0 +1,6 @@
+extern int c2();
+
+int d()
+{
+ return c2() + 2;
+}
diff --git a/Tests/Dependency/Case1/main.c b/Tests/Dependency/Case1/main.c
new file mode 100644
index 0000000..07191cc
--- /dev/null
+++ b/Tests/Dependency/Case1/main.c
@@ -0,0 +1,10 @@
+extern int b();
+extern int c();
+extern int d();
+
+int main()
+{
+ c();
+ b();
+ d();
+}