diff options
Diffstat (limited to 'Tests/Dependency/Case1')
-rw-r--r-- | Tests/Dependency/Case1/CMakeLists.txt | 19 | ||||
-rw-r--r-- | Tests/Dependency/Case1/a.c | 5 | ||||
-rw-r--r-- | Tests/Dependency/Case1/b.c | 6 | ||||
-rw-r--r-- | Tests/Dependency/Case1/b2.c | 4 | ||||
-rw-r--r-- | Tests/Dependency/Case1/c.c | 6 | ||||
-rw-r--r-- | Tests/Dependency/Case1/c2.c | 6 | ||||
-rw-r--r-- | Tests/Dependency/Case1/d.c | 7 | ||||
-rw-r--r-- | Tests/Dependency/Case1/main.c | 10 |
8 files changed, 63 insertions, 0 deletions
diff --git a/Tests/Dependency/Case1/CMakeLists.txt b/Tests/Dependency/Case1/CMakeLists.txt new file mode 100644 index 000000000..4c5fc2037 --- /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 000000000..d702db1af --- /dev/null +++ b/Tests/Dependency/Case1/a.c @@ -0,0 +1,5 @@ +int a() +{ + return 5; +} + diff --git a/Tests/Dependency/Case1/b.c b/Tests/Dependency/Case1/b.c new file mode 100644 index 000000000..6bdfafafb --- /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 000000000..f37e1bb75 --- /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 000000000..c180a59b6 --- /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 000000000..4cf4426e5 --- /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 000000000..ea5457d4d --- /dev/null +++ b/Tests/Dependency/Case1/d.c @@ -0,0 +1,7 @@ +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 000000000..1e5f6d4aa --- /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(); +} |